Public paste
index.php
By: Xmoo | Date: Sep 2 2008 09:52 | Format: PHP | Expires: never | Size: 2.92 KB | Hits: 1253

  1. <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') {
  2.                 var_dump($_POST);
  3.                 if ($_POST['checkbox'] == 'CHECKED') {
  4.                 $insert = "INSERT INTO bloem_db (a_voornaam, a_achternaam, a_adres, a_postcode, a_email, v_voornaam, v_achternaam, v_adres, v_postcode, v_email, bericht)
  5.                                    values ('". $_POST["a_voornaam"] ."', '". $_POST["a_achternaam"] ."', '". $_POST["a_adres"] ."', '". $_POST["a_postcode"] ."', '". $_POST["a_email"] ."', '". $_POST["v_voornaam"] ."', '". $_POST["v_achternaam"] ."', '". $_POST["v_adres"] ."', '". $_POST["v_postcode"] ."', '". $_POST["v_email"] ."', '". $_POST["bericht"] ."')";
  6.                 $query = mysql_query($insert)or die(mysql_error());
  7.                 echo "<p>U aanvraag is verstuurd.</p>";
  8.         }
  9.         else {
  10.                
  11.                 echo "<form action="index.php" method="post">";
  12.                 echo "<label for="Naam" id="Naam">Voornaam*</label>";
  13.                 echo "<input type="text" name="a_voornaam" size="49"/>";
  14.                 echo "<br />";
  15.                 echo "<label for="Achternaam" id="Achternaam">Achternaam*</label>";
  16.                 echo "<input name="a_achternaam" type="text" size="49" />";
  17.                 echo "<br />";
  18.                 echo "<label for="Adres" id="Adres">Adres*</label>";
  19.                 echo "<input type="text" name="a_adres" size="49"/>";
  20.                 echo "<br />";
  21.                 echo "<label for="Postcode" id="Postcode">Postcode*</label>";
  22.                 echo "<input type="text" name="a_postcode" size="49"/>";
  23.                 echo "<br />";
  24.                 echo "<label for="Email" id="Email">Email*</label>";
  25.                 echo "<input type="text" name="a_email"size="49" />";
  26.                 echo "<br />";
  27.                 echo "<br />";
  28.                 echo "<br />";
  29.                 echo "<br style="margin-bottom:1em;" />";
  30.                
  31.                 echo "<label for="Voornaam2" id="Voornaam2">Voornaam*</label>";
  32.                 echo "<input type="text" name="v_voornaam" size="49"/>";
  33.                 echo "<br />";
  34.                 echo "<label for="Achternaam2" id="Achternaam2">Achternaam*</label>";
  35.                 echo "<input type="text" name="v_achternaam" size="49"/>";
  36.                 echo "<br />";
  37.                 echo "<label for="Adres2" id="Adres2">Adres*</label>";
  38.                 echo "<input type="text" name="v_adres" size="49"/>";
  39.                 echo "<br />";
  40.                 echo "<label for="Postcode2" id="Postcode2">Postcode*</label>";
  41.                 echo "<input type="text" name="v_postcode" size="49"/>";
  42.                 echo "<br />";
  43.                 echo "<label for="Email2" id="Email2">Email*</label>";
  44.                 echo "<input type="text" name="v_email" size="49"/>";
  45.                 echo "<br />";
  46.                 echo "<label for="Berichtje" id="Berichtje" >Berichtje*</label>";
  47.                 echo "<input type="text" size="49" name="bericht"  value="Gefeliciteerd beste collega!"/>";
  48.                 echo "<br />";
  49.                 echo "<label><INPUT TYPE="checkbox" NAME="checkbox" VALUE="checkbox"></label> <b>Ik ga akkoord met de algemene voorwaarden.</b>";
  50.                 echo "<p>";
  51.                 echo "<input type="submit" name="submit" value="" class="submit-button" />";    
  52.                 echo "</p>";
  53.                 echo "<p style="margin:0 2em 0 0; padding:0; text-align:right;">Velden met een * zijn verplicht in te vullen </p>";
  54.                 echo "</form>";
  55.         }
  56.         }
  57.                 ?>