Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $continue = '';
- $sessiontekst = md5(date("d-m-Y"));
- $sessionname = "Secure";
- if(!isset($_SESSION[$sessionname]) or $_SESSION[$sessionname] != $sessiontekst)
- {
- $continue = 'Je bent niet ingelogd';
- }
- if($continue == '') {
- include("config.inc.php");
- // startup
- $result_final = "";
- $counter = 0;
- // Arrays bouwen
- $opmerking = $_POST['opmerkingen'];
- $datum = $_POST['datum'];
- $docent = $_POST['docent'];
- $vak = $_POST['vak'];
- $stroming = $_POST['stroming'];
- $lokaal = $_POST['lokaal'];
- $tijd = $_POST['tijd'];
- while ($counter < count($datum))
- {
- if ($datum[$counter] == '')
- { echo 'Geen datum ingevoerd<br>';}
- elseif ($tijd[$counter] == '')
- { echo 'Geen tijd ingevoerd<br>';}
- else {
- $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])."')" );
- $result_final .= "Toets ".($counter+1)." toegevoegd<br />";
- }
- $counter++;
- mysql_error();
- }
- // Print Result
- echo <<<__HTML_END
- <html>
- <head>
- <title>Toetsen toegevoegd</title>
- </head>
- <body>
- $result_final
- </body>
- </html>
- __HTML_END;
- }
- else {
- echo $continue;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment