Public paste
tester
By: Ruben | Date: Nov 12 2007 21:57 | Format: PHP | Expires: never | Size: 1.33 KB | Hits: 1687

  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                        = $this->db->escape($post['dag']);
  10.     $maand                      = $this->db->escape($post['maand']);
  11.     $jaar                       = $this->db->escape($post['jaar']);
  12.         $uren                   = $this->db->escape($post['uren']);
  13.         $minutes                = $this->db->escape($post['minutes']);
  14.         $seconds                = $this->db->escape($post['seconds']);
  15.     $functie            = $_POST['functie'];
  16.     $salaris            = $_POST['salaris'];
  17.     $status                     = $_POST['status'];
  18.     $omschrijving       = $_POST['omschrijving'];
  19.        
  20.     $datum = mktime($uren, $minutes, $seconds, $maand, $dag, $jaar);
  21.     $datum_db = $this->db->escape($datum);
  22.  
  23. if (empty($titel)) $titel = " '' ";
  24. if (empty($functie)) $functie = " '' ";
  25. if (empty($salaris)) $salaris = " '' ";
  26. if (empty($status)) $status = " '' ";
  27. if (empty($omschrijving)) $omschrijving = " '' ";
  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>! Pagina is succesvol aangemaakt!</h5><meta http-equiv="refresh" content="1;URL=index.php?p=vacatures" />';
  34.  
  35. }
  36. ?>