Hez guys,
first of all I have to admit that I have NO clue about php and
building an contact form is my first contact with it.
However I use the following contact form:
<form id="formID" class="formular" action="restaurant-kontakt-sent.php" method="post" >
<fieldset>
<legend>
Persönliche Angaben
</legend>
<table>
<tr>
<td>
<span style="color:#FF0000">*</span><span>Name:</span>
</td>
<td>
<label>
<input value="<?=$_SESSION['post']['name']?>" class="validate[required,custom[onlyLetterSp]] text-input" type="text" name="name" id="name" />
</label>
</td>
</tr>
<tr>
<td>
<span style="color:#FF0000">*</span><span>Email: </span>
</td>
<td>
<label>
<input value="<?=$_SESSION['post']['email']?>" class="validate[required,custom[email]] text-input" type="text" name="email" id="email" />
</label>
</td>
</tr>
<tr>
<td>
<span>Adresse:</span>
</td>
<td>
<label>
<input value="<?=$_SESSION['post']['adresse']?>" class="validate[custom[onlyLetterNumber]] text-input" type="text" name="adresse" id="adresse" />
</label>
</td>
</tr>
<tr>
<td>
<span>Telefon: </span><br><span style="font-size:9px;">(Bitte mit Vorwahl)</span>
</td>
<td>
<label>
<input value="<?=$_SESSION['post']['tele']?>" class="validate[custom[phone]] text-input" type="text" name="tele" id="tele" />
</label>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>
Weitere Angaben
</legend>
<table>
<tr>
<td>
<span>Unternehmen:</span>
</td>
<td>
<label>
<input value="<?=$_SESSION['post']['uname']?>" class="validate[custom[onlyLetterNumber]] text-input" type="text" name="uname" id="uname" />
</label>
</td>
</tr>
<tr>
<td>
<span>Website:</span>
</td>
<td>
<label>
<input value="http://" class="validate[custom[url]] text-input" type="text" name="website" id="website" />
</label>
</td>
</tr>
<tr>
<td>
<span>Unternehmen <br>zuordnen:</span>
</td>
<td>
<label>
<select name="unternehmenstyp" id="unternehmenstyp" class="validate[custom]">
<option value="option1">Bars, Pubs & Kneipen</option>
<option value="option2">Cafes & Bistros</option>
<option value="option3">Catering & Partyservice</option>
<option value="option1">Clubs & Diskotheken</option>
<option value="option2">Events & Veranstaltungen</option>
<option value="option3">Imbiss, Pizza & Fast Food</option>
<option value="option1">Kinos</option>
<option value="option2">Lieferservice</option>
<option value="option3">Pensionen, Hostels & Jugendherbergen</option>
<option value="option3">Restaurants</option>
<option value="option3">Andere</option>
</select>
</td>
</tr>
</table>
</label>
</fieldset>
<fieldset>
<legend>
Ihre Nachricht
</legend>
<table>
<tr>
<td>
<span>Betreff:</span>
</td>
<td>
<label>
<input value="<?=$_SESSION['post']['betreff']?>" class="validate[custom[onlyLetterNumber]] text-input" type="text" name="betreff" id="betreff" />
</label>
</td>
</tr>
<tr>
<td>
<span>Nachricht:</span>
</td>
<td>
<label>
<textarea class="validate[required] text-input" rows="4" cols="40" name="anschreiben" id="anschreiben" > <?=$_SESSION['post']['message']?> </textarea>
</label>
</td>
</tr>
</table>
<!--
<div>
<span>Datei zum Anhang hinzufügen:</span>
<input class="validate[custom[]] text-input" type="file" name="anhang" id="anhang"/>
</div>
-->
</fieldset>
<input class="submit" type="submit" value="Senden!"/><hr/>
</form>
And the following restaurant-kontakt-sent.php:
<?php
if(isset($_POST['submit']))
{
$to = '
[email protected]';
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$adresse = $_POST['adresse'] ;
$telefon = $_POST['tele'] ;
$unternehmensname = $_POST['uname'] ;
$unternehmenstyp = $_POST['unternehmenstyp'] ;
$betreff = $_POST['betreff'] ;
$anschreiben = $_POST['anschreiben'] ;
//$headers = "From: $Nachname <$Email>";
//$error = "";
//if (trim($nachname)=="" || trim($email)==""|| trim($anschreiben)=="" )
//{
//$error = "Ooops! Nachname, Emailadresse und Anschreiben sind Pflichtfelder."
//}
mail($to, $vorname, $nachname, $email, $adresse, $telefon, $unternehmensname, $unternehmenstyp, $betreff, $anschreiben) ;
if (mail($to, $vorname, $nachname, $email, $adresse, $telefon, $unternehmensname, $unternehmenstyp, $betreff, $anschreiben))
header("Location:/restaurant-kontakt-gesendet.html");
else
header("Location:/restaurant-kontakt-error.html");
}
?>
My problem is:
1. There is no mail coming (my host is 1und1.de and it is not inside the span or junk folder)?
2. And after pushing the submit button the user gets not passed to the the restaurant-kontakt-error.html or restaurant-kontakt-gesendet.html.
Could anyone give me the right direction?