<?php
ob_start();
session_start();
include("../../../config.php");
$dte=date('d/m/Y');
$dtdoc=date('Y-m-d');
$dteE=date('Y-m-d h:i:s');
$added_by=$_SESSION['user'];
$added_on=date('Y-m-d h:i:s');
$filephoto=$_FILES['pdf']['name'];
$uploadphoto=$_SERVER['DOCUMENT_ROOT'].$download_path;
$fileNamephoto=$filephoto;
$target_pathphoto = $uploadphoto . $fileNamephoto;
move_uploaded_file($_FILES['pdf']['tmp_name'], $target_pathphoto);
$sql="insert into latest(title,link,pdf,added_by,added_on)";
$sql.=" values(";
$sql.="'".$_POST['title']."',";
$sql.="'".$_POST['link']."',";
$sql.="'".$fileNamephoto."',";
$sql.="'".$added_by."',";
$sql.="'".$added_on."')";
//echo $sql;
//die();
$UsQuery =mysqli_query($conn,$sql);
if($UsQuery){
header('location:'.$home_path.'/pages/master/addlatest.php?msg=success&rcpt=');
}else{
header('location:'.$home_path.'/pages/master/addlatest.php?msg=error');
}
?>
|