Nicketick

Untitled

Mar 4th, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.34 KB | None | 0 0
  1. <?php
  2.     include("config.inc.php");
  3. $continue = '';
  4. $sessiontekst = md5(date("d-m-Y"));
  5. $sessionname = "Secure";
  6. if(!isset($_SESSION[$sessionname]) or $_SESSION[$sessionname] != $sessiontekst)
  7. {
  8. $continue = 'Je bent niet ingelogd';
  9. }
  10. if($continue == '') {
  11.  
  12.     // startup
  13.     $result_final = "";
  14.     $counter = 0;
  15.  
  16.     // Arrays bouwen
  17.     $opmerking = $_POST['opmerkingen'];
  18.     $datum = $_POST['datum'];
  19.     $docent = $_POST['docent'];
  20.     $vak = $_POST['vak'];
  21.     $stroming = $_POST['stroming'];
  22.     $lokaal = $_POST['lokaal'];
  23.     $tijd = $_POST['tijd'];
  24.    
  25.  
  26.     while ($counter < count($datum))
  27.     {
  28.     if ($datum[$counter] == '')
  29.     { echo 'Geen datum ingevoerd<br>';}
  30.     elseif ($tijd[$counter] == '')
  31.     { echo 'Geen tijd ingevoerd<br>';}
  32.     else {
  33. $query = mysql_query( "INSERT INTO toetsrooster(`docent`, `vak`, `lokaal`, `datum`, `tijd`,  `richting`, `opmerkingen`) VALUES('".addslashes($docent[$counter])."', '".addslashes($vak[$counter])."', '".addslashes($lokaal[$counter])."', '".addslashes($datum[$counter])."', '".addslashes($tijd[$counter])."',  '".addslashes($stroming[$counter])."', '".addslashes($opmerking[$counter])."')" );
  34. $result_final .= "Toets ".($counter+1)." toegevoegd<br />";
  35.     }
  36.     $counter++;
  37.     mysql_error();
  38.     }
  39.  
  40.  
  41.     // Print Result
  42. echo <<<__HTML_END
  43.  
  44. <html>
  45. <head>
  46.     <title>Toetsen toegevoegd</title>
  47. </head>
  48. <body>
  49.     $result_final
  50. </body>
  51. </html>
  52.  
  53. __HTML_END;
  54. }
  55. else {
  56.     echo $continue;
  57. }
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment