PHP gevorderde | 
                 | 
                
				
				mail.php  
    
    
        
            
                <?php
if(isset($_POST["mail"]) && $_POST["mail"] != " ")
{
	if(mail("emailadres", "Mail site", $message, "From:".$mail))
	{
		echo "<p>Bedankt voor uw e-mail, uw bericht werd verzonden.</p>";
	}
	else
	{
		echo "<p>Sorry, uw bericht kon niet worden verzonden!</p>";
	}
}
else
{
	echo "Er loopt hier iets heel erg mis!";
}
?>
             
            <?php if(isset($_POST["mail"]) && $_POST["mail"] != " ") { 	if(mail("emailadres", "Mail site", $message, "From:".$mail)) 	{ 		echo "<p>Bedankt voor uw e-mail, uw bericht werd verzonden.</p>"; 	} 	else 	{ 		echo "<p>Sorry, uw bericht kon niet worden verzonden!</p>"; 	} } else { 	echo "Er loopt hier iets heel erg mis!"; } ?> 
 
  
         
          
     
   
maximailer.php  
    
    
        
            
                <?php
$submit=$_POST['submit'];
$voornaam=$_POST['voornaam'];
$achternaam=$_POST['achternaam'];
$mail=$_POST['mail'];
$opinie=$_POST['opinie'];
echo "<h1>Een Opinie Formulier Opmaak</h1><hr>";
if(empty($submit))
{
	echo "<h3>1. Gelieve uw gegevens in te vullen.</h3>";
	echo "<form action=\"$_SERVER[PHP_SELF]\" method=\"post\">";
	echo "Voornaam: <input type=\"text\" name=\"voornaam\" /><br /><br />";
	echo "Achternaam: <input type=\"text\" name=\"achternaam\" /><br /><br />";
	echo "E-mailadres: <input type=\"text\" name=\"mail\" /><br /><br />";
	echo "<h3>Wat vind je van de site?</h3>";
	echo "<textarea name=\"opinie\" cols=\"50\" rows=\"5\" warp=\"soft\">";
	echo "</textarea><br /><br />";
	echo "<input type=\"reset\" name=\"reset\" value=\"Alles Wissen\">";
	echo "<input type=\"submit\" name=\"submit\" value=\"OK verzend\">";
	echo "</form>";
}
else
{
	echo "<h3>2. Gelieve de gegevens na te zien.</h3>";
	foreach($_POST as $key => $value)
	{
		if(empty($value))
		{
			echo "<p> Gelieve alle velden in te vullen A.U.B.!</p>";
			echo "<form>";
			echo "<input type=\"button\" value=\"Keer terug naar de vorige pagina\" onclick=\"javascript:history.back()\">";
			echo "<noscript>Geen Javascript. Klik op de knop Vorige in je webbrowser</noscript>";
			exit;
		}
	}
	echo "<p>Dag <b>$voornaam $achternaam!</b></p>\n";
	echo "<p>Uw e-mailadres is <b>$mail</b>!</p>\n";
	echo "<p>U screef:<p>\n";
	echo "<i>". stripslashes(nl2br($opinie)) ."</i><br /><br />\n";
	echo "<p>Zijn deze gegevens correct?</p><br />\n";
	$message="$voornaam $achternaam,$mail heeft geschrefen\n$opinie";
	$message=htmlspecialchars($message);
	echo "<form action=\"mail.php\" method=\"post\"\n";
	echo "<input type=\"hidden\" name=\"mail\" value=\"$mail\">\n";
	echo "<input type=\"hidden\" name=\"message\" value=\"$message\">\n";
	echo "<input type=\"button\" value=\"Neen\" ";
	echo "onclick=\"javascript:history.back()\">\n";
	echo "<noscript>Geen Javascript. Klik op de knop Vorige in je webbrowser</noscript>";
	echo "<input type=\"submit\" name=\"mail verzenden\" ";
	echo "value=\"Alles is correct!\">\n";
}
?>
             
            <?php $submit=$_POST['submit']; $voornaam=$_POST['voornaam']; $achternaam=$_POST['achternaam']; $mail=$_POST['mail']; $opinie=$_POST['opinie'];   echo "<h1>Een Opinie Formulier Opmaak</h1><hr>"; { 	echo "<h3>1. Gelieve uw gegevens in te vullen.</h3>"; 	echo "<form action=\"$_SERVER[PHP_SELF]\" method=\"post\">"; 	echo "Voornaam: <input type=\"text\" name=\"voornaam\" /><br /><br />"; 	echo "Achternaam: <input type=\"text\" name=\"achternaam\" /><br /><br />"; 	echo "E-mailadres: <input type=\"text\" name=\"mail\" /><br /><br />"; 	echo "<h3>Wat vind je van de site?</h3>"; 	echo "<textarea name=\"opinie\" cols=\"50\" rows=\"5\" warp=\"soft\">"; 	echo "</textarea><br /><br />"; 	echo "<input type=\"reset\" name=\"reset\" value=\"Alles Wissen\">"; 	echo "<input type=\"submit\" name=\"submit\" value=\"OK verzend\">"; } else { 	echo "<h3>2. Gelieve de gegevens na te zien.</h3>"; 	foreach($_POST as $key => $value) 	{ 		{ 			echo "<p> Gelieve alle velden in te vullen A.U.B.!</p>"; 			echo "<input type=\"button\" value=\"Keer terug naar de vorige pagina\" onclick=\"javascript:history.back()\">"; 			echo "<noscript>Geen Javascript. Klik op de knop Vorige in je webbrowser</noscript>"; 		} 	} 	echo "<p>Dag <b>$voornaam $achternaam!</b></p>\n"; 	echo "<p>Uw e-mailadres is <b>$mail</b>!</p>\n"; 	echo "<p>U screef:<p>\n"; 	echo "<p>Zijn deze gegevens correct?</p><br />\n"; 	$message="$voornaam $achternaam,$mail heeft geschrefen\n$opinie"; 	echo "<form action=\"mail.php\" method=\"post\"\n"; 	echo "<input type=\"hidden\" name=\"mail\" value=\"$mail\">\n"; 	echo "<input type=\"hidden\" name=\"message\" value=\"$message\">\n"; 	echo "<input type=\"button\" value=\"Neen\" "; 	echo "onclick=\"javascript:history.back()\">\n"; 	echo "<noscript>Geen Javascript. Klik op de knop Vorige in je webbrowser</noscript>"; 	echo "<input type=\"submit\" name=\"mail verzenden\" "; 	echo "value=\"Alles is correct!\">\n"; } ?> 
 
  
         
          
     
   
 
maximailer.php  Dit werkt maar dan loopt alles in het donder.				
				 |