Location: PHPKode > projects > Db-newsletter > db-newsletter/include/form.php
<?

/*
Copyright (c) 2007-2008, Daniel Braun

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


include ("mysql.php");
$do = $_GET['do'];


$dat0 = $_SERVER['SERVER_NAME'].$verzeichnis;
$dat1 = "include/form.php?do=send";
$dat  = $dat0.$dat1;
if($do == "send")
{
 $anrede = $_POST['anrede'];
 $vorname = $_POST['vorname'];
 $nachname = $_POST['nachname'];
 $email = $_POST['email'];

 list($dn, $maildomain) = split("@", $email); //e-mail adresse "zerlegen"
 if (@checkdnsrr($maildomain, "MX")) //überprüfen ob Mail-Domain gültig
 {
  $query = "INSERT INTO liste (anrede, vorname, nachname, email, status) VALUES ('$anrede', '$vorname', '$nachname', '$email', 'new')";
  $dummy = mysql_query($query);
  echo "<br><br><h1>Ihr Eintrag war erflogreich!<h1><br><br>";
 }
 
 else
 {
  echo "<br><br><h1>Bitte geben Sie eine gültige E-Mail Adresse an!<h1><br><br>";
 }
}
else
{
 echo

							"<form action=\"http://$dat \" method=\"post\">
								<br />
								<table width=\"122\" cellspacing=\"2\" cellpadding=\"0\" border=\"0\">
									<tbody><tr>
										<td></td>
										<td><select name=\"anrede\" size=\"1\">
												<option value=\"Herr\">Herr</option>
												<option value=\"Frau\">Frau</option>
											</select><br>
											<br>
										</td>
									</tr>
									<tr>
										<td>Vorname </td>
										<td><input type=\"text\" name=\"vorname\" size=\"24\" /></td>
									</tr>
									<tr>
										<td>Nachname </td>
										<td><input type=\"text\" name=\"nachname\" size=\"24\" /></td>
									</tr>
									<tr>
										<td> e-mail</td>
										<td><input type=\"text\" name=\"email\" size=\"24\" /></td>
									</tr>
								</tbody></table>
								
								<p>&nbsp;</p><p>         <input type=\"hidden\" name=\"id\" value=\"false\" /></p>
								<p> <br /><input type=\"submit\" name=\"submitButtonName\" value=\"Eintragen\" /></p></form></div>";
}
?>
Return current item: Db-newsletter