CasperSecurity
<?php
session_start();
include("../includes/connection.php");
$syllabus_title = $_REQUEST['syllabus_title'];
$sem_name = $_REQUEST['semester_name'];
$dates = date("Y-m-d H:i:s");
$imgnames = $_FILES['images']['name'];
$extension=end(explode('.', $imgnames));
$imgname=$imgnames.''.$dates.'.'.$extension;
$photoPath = "uploads/pdf/";
$imgtype = pathinfo($imgname,PATHINFOEXTENSION);
$tempname = $_FILES['images']['tmp_name'];
$photoUpload = move_uploaded_file($tempname,$photoPath.$imgname);
$date = date("Y-m-d");
db_query("insert into syllabus_upload set syllabus_title='$syllabus_title',semester_name='$sem_name',images='$imgname'");
$msg = "Syllabus Upload Successfully.";
setcookie("msg", $msg, time() + 3);
print "<script>";
print "self.location = 'syllabus.php';";
print "</script>";
exit;
?>