PHP ver gevorderde |
|
ok, heb het script al wat veranderd om te testen zonder resultaat, maar dit heb ik nu:
<?php
if(isset($_POST['mail']))
{
$aan = $_POST['aan'];
$onderwerp = $_POST['onderwerp'];
$bericht = $_POST['bericht'];
$van = $_POST['van'];
$email = $_POST['email'];
$headers = "From:".$van."<".$email.">";
mail($aan,$onderwerp,$bericht,$headers);
}
else
{
?>
<form name="form1" method="post" action="">
Aan:<br>
<?php
if(isset($_GET['mail']))
{
echo('<input name="aan1" id="aan1" type="text" size="35" value="'.$_GET['mail'].'" disabled>');
}
else
{
echo('<input name="aan" id="aan" type="text" size="35">');
};
?>
<br>
Onderwerp:<br>
<input name="onderwerp" type="text" id="onderwerp" size="35">
<br>
Uw naam:<br>
<input name="van" type="text" id="naam" size="35">
<br>
Uw email:<br>
<input name="email" type="text" id="email" size="35">
<br>
Bericht:<br>
<textarea name="bericht" cols="50" rows="7"></textarea>
<br>
<input name="mail" type="submit" id="mail" value="Verzend">
<input type="reset" name="Reset" value="Reset">
</form>
<?php
};
?>
<?php if(isset($_POST['mail'])) { $aan = $_POST['aan']; $onderwerp = $_POST['onderwerp']; $bericht = $_POST['bericht']; $van = $_POST['van']; $email = $_POST['email']; $headers = "From:".$van."<".$email.">"; mail($aan,$onderwerp,$bericht,$headers); } else { ?> <form name="form1" method="post" action=""> Aan:<br> <?php { echo('<input name="aan1" id="aan1" type="text" size="35" value="'.$_GET['mail'].'" disabled>'); } else { echo('<input name="aan" id="aan" type="text" size="35">'); }; ?> <br> Onderwerp:<br> <input name="onderwerp" type="text" id="onderwerp" size="35"> <br> Uw naam:<br> <input name="van" type="text" id="naam" size="35"> <br> Uw email:<br> <input name="email" type="text" id="email" size="35"> <br> Bericht:<br> <textarea name="bericht" cols="50" rows="7"></textarea> <br> <input name="mail" type="submit" id="mail" value="Verzend"> <input type="reset" name="Reset" value="Reset"> </form> <?php }; ?>
|