Gå til innhold

Trenger hjelp med mail form! Prøvd flere ganger selv!


Anbefalte innlegg

Hallo, jeg hadde tenkt å redigere en mail form, men har en del problem, har prøvd mange ganger selv..

Er det mail form som har problemet? Eller er det jeg som ikke gjør det riktig.

 

Antal kbm/säckar*

Önskad längd ( 27 - 90 cm )*

Typ av ved*

Namn*

Gatuadress*

Postadress

Telefon*

Mobil

Vil ha inn disse!

 

Og her er php koden:

 

<?php

/**********************************/
/*	   EMAIL CONTACT FORM	   */
/*		  VERSION 1.1		   */
/* Copyright 2004 (c) Epleweb.com */
/**********************************/

/*	GNU General Public License
--------------------------------------------------------------------
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

if ($_POST['submit'] == TRUE) {
$receiverMail = "[email protected]";
$name		= stripslashes(strip_tags($_POST['name']));
$email		= stripslashes(strip_tags($_POST['email']));
			$blabla		= stripslashes(strip_tags($_POST['blabla']));
$subject	= stripslashes(strip_tags($_POST['subject']));
$msg		= stripslashes(strip_tags($_POST['msg']));
$ip			= $_SERVER['REMOTE_ADDR'];
			$msgformat	= "From: $name ($ip)\nEmail: $email\n\n$msg\n$blabla";


if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
	echo "<h2>The email was not sent</h2><p>Please fill all the required fields</p>";
}
elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
	echo "<h2>The email was not sent</h2><p>The email address is invalid</p>";
}
elseif(mail($receiverMail, $subject, $msgformat, "From: $name <$email>")) {
	echo "<h2>The email has been sent!</h2><p>I will get back to you as soon as possible.</p>"; }
else {
	echo "<h2>The email was not sent</h2><p>Please try again... If the problem continues there's probably something wrong with the server.</p>";
}
}
else { ?>
<form method="post" action="">
<p>
<label for="name">Name</label>
<input id="name" name="name" type="text" size="30" maxlength="40" /><br />

<label for="email">Email</label>
<input id="email" name="email" type="text" size="30" maxlength="40" /><br />

<label for="subject">Subject</label>
<input id="subject" name="subject" type="text" size="30" maxlength="40" /><br />

	<label for="blabla">Bla Bla</label>
	<input id="blabla" name="blabla" type="text" size="30" maxlength="40" /><br />

<label for="message">Message</label>
<textarea id="message" name="msg" cols="50" rows="6"></textarea><br />

<label for="submit"> </label>
<input id="submit" class="button" type="submit" name="submit" value="Send" />
</p>
</form>
<?php } ?>

 

Takker for den som hjelper, har gjort det flere ganger men har ikke klart det!

 

TAKK!

Lenke til kommentar
Videoannonse
Annonse
Antal kbm/säckar*

Önskad längd ( 27 - 90 cm )*

Typ av ved*

Namn*

Gatuadress*

Postadress

Telefon*

Mobil

 

 

Legg til input til hvert av dem;)

 

<br>
Mobil:
<input type="text" name="mobil"><br>

PHP:

 

$mob_input = $_POST['mobil']

 

Har prøvd, ser ikke helt ut som om den virker? Gjør jeg feil?

 

Her er linken: http://vedexperten.se/try.php

Endret av Fight4Lov3
Lenke til kommentar
Antal kbm/säckar*

Önskad längd ( 27 - 90 cm )*

Typ av ved*

Namn*

Gatuadress*

Postadress

Telefon*

Mobil

 

 

Legg til input til hvert av dem;)

 

<br>
Mobil:
<input type="text" name="mobil"><br>

PHP:

 

$mob_input = $_POST['mobil']

 

Har prøvd, ser ikke helt ut som om den virker? Gjør jeg feil?

 

Her er linken: http://vedexperten.se/try.php

 

 

Det er helt hvit skjerm?

 

Prøv:

 

 

<?php

if (isset($_POST['submit'])) {
$receiverMail = "[email protected]";
$name		= stripslashes(strip_tags($_POST['name']));
$email		= stripslashes(strip_tags($_POST['email']));
			$blabla		= stripslashes(strip_tags($_POST['blabla']));
$subject	= stripslashes(strip_tags($_POST['subject']));
$msg		= stripslashes(strip_tags($_POST['msg']));
$ip			= $_SERVER['REMOTE_ADDR'];
			$msgformat	= "From: $name ($ip)\nEmail: $email\n\n$msg\n$blabla";


if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
	echo "<h2>The email was not sent</h2><p>Please fill all the required fields</p>";
}
elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
	echo "<h2>The email was not sent</h2><p>The email address is invalid</p>";
}
elseif(mail($receiverMail, $subject, $msgformat, "From: $name <$email>")) {
	echo "<h2>The email has been sent!</h2><p>I will get back to you as soon as possible.</p>"; }
else {
	echo "<h2>The email was not sent</h2><p>Please try again... If the problem continues there's probably something wrong with the server.</p>";
}
}
?>
<form method="post" action="">
<p>
<label for="name">Name</label>
<input id="name" name="name" type="text" size="30" maxlength="40" /><br />

<label for="email">Email</label>
<input id="email" name="email" type="text" size="30" maxlength="40" /><br />

<label for="subject">Subject</label>
<input id="subject" name="subject" type="text" size="30" maxlength="40" /><br />

	<label for="blabla">Bla Bla</label>
	<input id="blabla" name="blabla" type="text" size="30" maxlength="40" /><br />

<label for="message">Message</label>
<textarea id="message" name="msg" cols="50" rows="6"></textarea><br />

<label for="submit"> </label>
<input id="submit" class="button" type="submit" name="submit" value="Send" />
</p>
</form>

 

Endret av Rematusen
Lenke til kommentar
Gjorde det..

 

Sjekk:

 

http://vedexperten.se/try.php

 

 

Jupp, nå fungerer det?

Bare legg til slik jeg sa lenger opp..

 

Jeg gjorde det, det men det førte til at det ble ingenting, som istad!

 

 

 

 

Du vet hvor du skal skrive hva?

 

altså jeg har prøvd flere ganger =(..

 

Mulig du kan gjøre det for meg? altså hvis du har tid? siden jeg er så lei av det! har prøvd flere flere ganger!

 

Om det er noe jeg kan gjøre for deg? Så kan du gjøre dette for meg? Takk

Lenke til kommentar

<?php

if (isset($_POST['submit'])) {
$receiverMail = "[email protected]";
$name		= stripslashes(strip_tags($_POST['name']));
$email		= stripslashes(strip_tags($_POST['email']));
$blabla		= stripslashes(strip_tags($_POST['email_2']));
$subject	= stripslashes(strip_tags($_POST['subject']));
$msg		= stripslashes(strip_tags($_POST['email_3']));
$msg_1		= stripslashes(strip_tags($_POST['email_4']));
$msg_2		= stripslashes(strip_tags($_POST['email_5']));
$msg_3		= stripslashes(strip_tags($_POST['email_6']));
$msg_4		= stripslashes(strip_tags($_POST['email_7']));
$ip			= $_SERVER['REMOTE_ADDR'];
			$msgformat	= "
			From: $msg ($ip)\n
			Telefon: $msg_3 MOB: $msg_4\n\n
			POSTADR: $msg_2\n
			GATU: $msg_1\n
			TYP AV VED: $blabla\n
			ØNSKET LENGE: $email\n
			Antal kbm/säckar: $name\n
			";


if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
	echo "<h2>The email was not sent</h2><p>Please fill all the required fields</p>";
}
elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
	echo "<h2>The email was not sent</h2><p>The email address is invalid</p>";
}
elseif(mail($receiverMail, $subject, $msgformat, "From: $name <$email>")) {
	echo "<h2>The email has been sent!</h2><p>I will get back to you as soon as possible.</p>"; }
else {
	echo "<h2>The email was not sent</h2><p>Please try again... If the problem continues there's probably something wrong with the server.</p>";
}
}
?>
<form method="post" action="">
<p>
<label for="subject">EMNE PÅ MAIL: *</label>
<input id="subject" name="subject" type="text" size="30" maxlength="40" />
<label for="name"><br>
Antal kbm/säckar*</label>
<input id="name" name="name" type="text" size="30" maxlength="40" /><br />

<label for="email">Önskad längd ( 27 - 90 cm )* </label>
<input id="email" name="email" type="text" size="30" maxlength="40" /><br />

<label for="message">Typ av ved*</label>
<input id="email" name="email_2" type="text" size="30" maxlength="40" /><br />

<label for="message">Namn*</label>
<input id="email" name="email_3" type="text" size="30" maxlength="40" /><br />

	<label for="blabla">Gatuadress*</label>
 <input id="email" name="email_4" type="text" size="30" maxlength="40" /><br />

<label for="message">Postadress </label>
<input id="email" name="email_5" type="text" size="30" maxlength="40" /><br />

<label for="message">Telefon* </label>
<input id="email" name="email_6" type="text" size="30" maxlength="40" /><br />

<label for="message">Mobil</label>
<input id="email" name="email_7" type="text" size="30" maxlength="40" /><br />

<label for="submit"> </label>
<input id="submit" class="button" type="submit" name="submit" value=" Send Mail " />
</p>
</form>

Lenke til kommentar

<?php

if (isset($_POST['submit'])) {
$receiverMail = "[email protected]";
$name		= stripslashes(strip_tags($_POST['name']));
$email		= stripslashes(strip_tags($_POST['email']));
$blabla		= stripslashes(strip_tags($_POST['email_2']));
$subject	= stripslashes(strip_tags($_POST['subject']));
$msg		= stripslashes(strip_tags($_POST['email_3']));
$msg_1		= stripslashes(strip_tags($_POST['email_4']));
$msg_2		= stripslashes(strip_tags($_POST['email_5']));
$msg_3		= stripslashes(strip_tags($_POST['email_6']));
$msg_4		= stripslashes(strip_tags($_POST['email_7']));
$ip			= $_SERVER['REMOTE_ADDR'];
			$msgformat	= "
			From: $msg ($ip)\n
			Telefon: $msg_3 MOB: $msg_4\n\n
			POSTADR: $msg_2\n
			GATU: $msg_1\n
			TYP AV VED: $blabla\n
			ØNSKET LENGE: $email\n
			Antal kbm/säckar: $name\n
			";


if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
	echo "<h2>The email was not sent</h2><p>Please fill all the required fields</p>";
}
elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
	echo "<h2>The email was not sent</h2><p>The email address is invalid</p>";
}
elseif(mail($receiverMail, $subject, $msgformat, "From: $name <$email>")) {
	echo "<h2>The email has been sent!</h2><p>I will get back to you as soon as possible.</p>"; }
else {
	echo "<h2>The email was not sent</h2><p>Please try again... If the problem continues there's probably something wrong with the server.</p>";
}
}
?>
<form method="post" action="">
<p>
<label for="subject">EMNE PÅ MAIL: *</label>
<input id="subject" name="subject" type="text" size="30" maxlength="40" />
<label for="name"><br>
Antal kbm/säckar*</label>
<input id="name" name="name" type="text" size="30" maxlength="40" /><br />

<label for="email">Önskad längd ( 27 - 90 cm )* </label>
<input id="email" name="email" type="text" size="30" maxlength="40" /><br />

<label for="message">Typ av ved*</label>
<input id="email" name="email_2" type="text" size="30" maxlength="40" /><br />

<label for="message">Namn*</label>
<input id="email" name="email_3" type="text" size="30" maxlength="40" /><br />

	<label for="blabla">Gatuadress*</label>
 <input id="email" name="email_4" type="text" size="30" maxlength="40" /><br />

<label for="message">Postadress </label>
<input id="email" name="email_5" type="text" size="30" maxlength="40" /><br />

<label for="message">Telefon* </label>
<input id="email" name="email_6" type="text" size="30" maxlength="40" /><br />

<label for="message">Mobil</label>
<input id="email" name="email_7" type="text" size="30" maxlength="40" /><br />

<label for="submit"> </label>
<input id="submit" class="button" type="submit" name="submit" value=" Send Mail " />
</p>
</form>

 

Takk for jobben du har gjort, men den virker ikke helt.

 

Sjekk: Http://www.vedexperten.se/ready.php

 

Når jeg prøver og sender teksten så kommer det

 

The email was not sent

 

The email address is invalid

 

Hva er problemet? Har du muligheten til å fikse den?

Endret av Fight4Lov3
Lenke til kommentar

 

 

<?php
if (isset($_POST['submit'])) {
$receiverMail = "[email protected]";
$name		= stripslashes(strip_tags($_POST['name']));
$email		= stripslashes(strip_tags($_POST['email']));
$blabla		= stripslashes(strip_tags($_POST['email_2']));
$subject	= stripslashes(strip_tags($_POST['subject']));
$msg		= stripslashes(strip_tags($_POST['email_3']));
$msg_1		= stripslashes(strip_tags($_POST['email_4']));
$msg_2		= stripslashes(strip_tags($_POST['email_5']));
$msg_3		= stripslashes(strip_tags($_POST['email_6']));
$msg_4		= stripslashes(strip_tags($_POST['email_7']));
$ip			= $_SERVER['REMOTE_ADDR'];
			$msgformat	= "
			From: $msg ($ip)\n
			Telefon: $msg_3 MOB: $msg_4\n\n
			POSTADR: $msg_2\n
			GATU: $msg_1\n
			TYP AV VED: $blabla\n
			ØNSKET LENGE: $email\n
			Antal kbm/säckar: $name\n
			";


if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
	echo "<h2>The email was not sent</h2><p>Please fill all the required fields</p>";
}
elseif(mail($receiverMail, $subject, $msgformat, "From: $name <$email>")) {
	echo "<h2>The email has been sent!</h2><p>I will get back to you as soon as possible.</p>"; }
else {
	echo "<h2>The email was not sent</h2><p>Please try again... If the problem continues there's probably something wrong with the server.</p>";
}
}
?>
<form method="post" action="">
<p>
<label for="subject">EMNE PÅ MAIL: *</label>
<input id="subject" name="subject" type="text" size="30" maxlength="40" />
<label for="name"><br>
Antal kbm/säckar*</label>
<input id="name" name="name" type="text" size="30" maxlength="40" /><br />

<label for="email">Önskad längd ( 27 - 90 cm )* </label>
<input id="email" name="email" type="text" size="30" maxlength="40" /><br />

<label for="message">Typ av ved*</label>
<input id="email" name="email_2" type="text" size="30" maxlength="40" /><br />

<label for="message">Namn*</label>
<input id="email" name="email_3" type="text" size="30" maxlength="40" /><br />

	<label for="blabla">Gatuadress*</label>
 <input id="email" name="email_4" type="text" size="30" maxlength="40" /><br />

<label for="message">Postadress </label>
<input id="email" name="email_5" type="text" size="30" maxlength="40" /><br />

<label for="message">Telefon* </label>
<input id="email" name="email_6" type="text" size="30" maxlength="40" /><br />

<label for="message">Mobil</label>
<input id="email" name="email_7" type="text" size="30" maxlength="40" /><br />

<label for="submit"> </label>
<input id="submit" class="button" type="submit" name="submit" value=" Send Mail " />
</p>
</form>

 

 

Feil enda?

Endret av Rematusen
Lenke til kommentar

 

<?php
if (isset($_POST['submit'])) {
$receiverMail = "[email protected]";
$name		= stripslashes(strip_tags($_POST['name']));
$email		= stripslashes(strip_tags($_POST['email']));
$blabla		= stripslashes(strip_tags($_POST['email_2']));
$subject	= stripslashes(strip_tags($_POST['subject']));
$msg		= stripslashes(strip_tags($_POST['email_3']));
$msg_1		= stripslashes(strip_tags($_POST['email_4']));
$msg_2		= stripslashes(strip_tags($_POST['email_5']));
$msg_3		= stripslashes(strip_tags($_POST['email_6']));
$msg_4		= stripslashes(strip_tags($_POST['email_7']));
$ip			= $_SERVER['REMOTE_ADDR'];
			$msgformat	= "
			From: $msg ($ip)\n
			Telefon: $msg_3 MOB: $msg_4\n\n
			POSTADR: $msg_2\n
			GATU: $msg_1\n
			TYP AV VED: $blabla\n
			ØNSKET LENGE: $email\n
			Antal kbm/säckar: $name\n
			";


if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
	echo "<h2>The email was not sent</h2><p>Please fill all the required fields</p>";
}
elseif(mail($receiverMail, $subject, $msgformat, "From: $name <$email>")) {
	echo "<h2>The email has been sent!</h2><p>I will get back to you as soon as possible.</p>"; }
else {
	echo "<h2>The email was not sent</h2><p>Please try again... If the problem continues there's probably something wrong with the server.</p>";
}
}
?>
<form method="post" action="">
<p>
<label for="subject">EMNE PÅ MAIL: *</label>
<input id="subject" name="subject" type="text" size="30" maxlength="40" />
<label for="name"><br>
Antal kbm/säckar*</label>
<input id="name" name="name" type="text" size="30" maxlength="40" /><br />

<label for="email">Önskad längd ( 27 - 90 cm )* </label>
<input id="email" name="email" type="text" size="30" maxlength="40" /><br />

<label for="message">Typ av ved*</label>
<input id="email" name="email_2" type="text" size="30" maxlength="40" /><br />

<label for="message">Namn*</label>
<input id="email" name="email_3" type="text" size="30" maxlength="40" /><br />

	<label for="blabla">Gatuadress*</label>
 <input id="email" name="email_4" type="text" size="30" maxlength="40" /><br />

<label for="message">Postadress </label>
<input id="email" name="email_5" type="text" size="30" maxlength="40" /><br />

<label for="message">Telefon* </label>
<input id="email" name="email_6" type="text" size="30" maxlength="40" /><br />

<label for="message">Mobil</label>
<input id="email" name="email_7" type="text" size="30" maxlength="40" /><br />

<label for="submit"> </label>
<input id="submit" class="button" type="submit" name="submit" value=" Send Mail " />
</p>
</form>

 

 

Feil enda?

 

Jeg vet ikke hva jeg skal si nå, men du reddet meg!!! TAKK!!!

 

VELDIG TAKK NEMLIG! Det må jeg si! Tusen hjertelig TAKK!

 

Takk for hjelpen!

Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
×
×
  • Opprett ny...