Public paste
test
By: Ruben | Date: Nov 12 2007 17:13 | Format: PHP | Expires: never | Size: 1.14 KB | Hits: 1329

  1. <?php
  2.  
  3. if ($_POST['submit']) {
  4.     foreach ($_POST as $key => $value) {
  5.         $value = stripslashes($value);
  6.         $_POST[$key] = "'".mysql_real_escape_string($value)."'";
  7.     }
  8.     $titel                      = $_POST['titel'];
  9.     $dag                        = $_POST['dag'];
  10.     $maand                      = $_POST['maand'];
  11.     $jaar                       = $_POST['jaar'];
  12.     $functie            = $_POST['functie'];
  13.     $salaris            = $_POST['salaris'];
  14.     $status                     = $_POST['status'];
  15.     $omschrijving       = $_POST['omschrijving'];
  16.  
  17. $datum = $dag.$maand.$jaar;
  18.  
  19. if (empty($titel)) $titel = " '' ";
  20. if (empty($dag)) $dag = " '' ";
  21. if (empty($maand)) $maand = " '' ";
  22. if (empty($jaar)) $jaar = " '' ";
  23. if (empty($functie)) $functie = " '' ";
  24. if (empty($salaris)) $salaris = " '' ";
  25. if (empty($status)) $status = " '' ";
  26. if (empty($omschrijving)) $omschrijving = " '' ";
  27.  
  28.  
  29.     mysql_query("INSERT INTO vacatures (`titel` , `datum` , 'functie', 'salaris' , 'status' , 'omschrijving')
  30.     VALUES ($titel, $datum, $functie, $salaris, $status, $omschrijving)
  31.    ");
  32.  
  33.                         print '<h5>Klaar is <span>KEES</span>! Vacature is toegevoegd!</h5><meta http-equiv="refresh" content="1;URL=index.php?p=vacatures" />';
  34.  
  35. }
  36. ?>