<?php
	include 'includes/session.php';
	include 'includes/sessions.php'; 

	if(isset($_POST['submit'])){
	   
		$course = $_POST['course'];
	

		$sql = "INSERT INTO course_upload (name) VALUES ('$course')";
		if($conn->query($sql)){

			$_SESSION['success'] = 'Courses added successfully';
		}
		else{ 
			$_SESSION['error'] = $conn->error;
		}
	}	
	else{
		$_SESSION['error'] = 'Fill up add form first';
	}

	header('location: course_list.php');

?>