Hi!
I have a problem with my form which sended with mail.
I have two files.
First the form without php.
<body>
<form name="form1" method="post" action="formular2.php">
<table width="380" border="0" cellspacing="21" cellpadding="0">
<tr>
<td class="ueberschrift">Send an E-mail Message</td>
</tr>
<tr>
<td class="text"><p>Your name:<br>
<input name="name" type="text" id="name" size="35" maxlength="50">
</p>
</td>
</tr>
<tr>
<td class="text"><p> Organization name: <br>
<input name="organization" type="text" id="organization5" size="35" maxlength="50">
</p>
</td>
</tr>
<tr>
<td class="text">E-mail address:<br>
<input name="mail" type="text" id="mail" size="35" maxlength="50"> </td>
</tr>
<tr>
<td class="text">Phone number:<br>
<input name="phone" type="text" id="phone" size="35" maxlength="30"> </td>
</tr>
<tr>
<td class="text">Message subject:<br>
<input name="subject" type="text" id="subject" size="35" maxlength="50"> </td>
</tr>
<tr>
<td class="text">Your message:<br>
<textarea name="message" cols="35" rows="10" id="message"></textarea> </td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Send Message"></td>
</tr>
</table>
</form>
That`s correct!
Second
<?php
$fehlen = "";
if (empty($name)){
$fehlen = $fehlen."Your name<br>";
}
if (empty($organization)){
$fehlen = $fehlen."organization name<br>";
}
if (empty($mail)){
$fehlen = $fehlen."E-mail address<br>";
}
if (empty($phone)){
$fehlen = $fehlen."phone number<br>";
}
if (empty($subject)){
$fehlen = $fehlen."message subject<br>";
}
if (empty($message)){
$fehlen = $fehlen."Your message";
}
if (!empty($fehlen)){
echo"Ihre Nachricht konnte leider nicht verschickt werden.<br>";
echo"Es fehlen folgende Angaben: <br><br>";
echo"$fehlen<br><br>";
echo"Bitte gehen Sie";?>
<a href="formular.php">zurück</a>
<?php echo"zum Formular.";
}
else {
$an = "sdsd@hotmail.com";
$cr = chr(13);
$lf = chr(10);
$ret = $cr.$lf;
$a1 = "Absender: $name $ret";
$a2 = "Organisation: $organization $ret";
$a3 = "E-mail Adresse: $mail $ret";
$a4 = "Telefon Nummer: $phone $ret $ret";
$nachricht = "$a1$a2$a3$a4$message";
mail($an, $subject, $nachricht);
}
?>
When the input field is empty, the user gets an error message.
And he must back to the form.
My problem is when he came back, all fields are empty.
The fields he wrote before should be in.
What can I do?
Sorry for my bad english!
Thank you very much!