Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if($_SESSION["id"]=='adminSession'){}
- else{
- header('Location:http://localhost/George/index.html');
- exit();
- }
- $con = mysqli_connect('localhost','root');
- if (!$con) { die('Could not connect ERROR: ' . mysqli_error()); }
- mysqli_select_db($con,"education");
- $days= implode(";", $_POST['days']);
- $hours="";
- if(isset($_POST['hoursMon'])){
- $temph = implode(",",$_POST['hoursMon']);
- $hours.= $temph.";";
- }
- if(isset($_POST['hoursTue'])){
- $temph = implode(",",$_POST['hoursTue']);
- $hours.= $temph.";";
- }
- if(isset($_POST['hoursWed'])){
- $temph = implode(",",$_POST['hoursWed']);
- $hours.= $temph.";";
- }
- if(isset($_POST['hoursThu'])){
- $temph = implode(",",$_POST['hoursThu']);
- $hours.= $temph.";";
- }
- if(isset($_POST['hoursFri'])){
- $temph = implode(",",$_POST['hoursFri']);
- $hours.= $temph.";";
- }
- $query = "INSERT INTO course(title,semester,professor_id,days,hours,class,type)
- VALUES('".$_POST["title"]."','".$_POST["semester"]."','".$_POST["professorid"]."','".$days."','".$hours."','".$_POST["class"]."','".$_POST["type"]."')";
- mysqli_query($con,$query);
- echo "Registration successful redirecting in main dashboard";
- echo "<script>
- var timer = setTimeout(function() {
- window.location='http://localhost/George/admin_main_dashboard.html'
- }, 3000);
- </script>";
- exit();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement