Nicketick

Untitled

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