
<?php
include ('session.php');
include('connection.php');
include('test.php');
header( 'Content-Type: text/html; charset=utf-8' );

$srno=test_input($_POST['srno']);
$title=test_input($_POST['head']);
$title1=test_input($_POST['head1']);
$dp1=test_input($_POST['dp1']);
$file2=test_input($_POST['file2']);
         
			         	         
$sql2="SELECT * from publication";
//echo $sql2;
$id=1;
$result11=mysqli_query($GLOBALS["___mysqli_ston"], $sql2) or die('Query Failed: ' . mysqli_error($GLOBALS["___mysqli_ston"]));
while($row1=mysqli_fetch_assoc($result11))
{		
$ss=$row1['srno'];
$id=$ss+1;
//echo $ss;
}

	$sql="UPDATE `publication` SET `title`='$title',`title1`='$title1',`user_date`='$dp1' WHERE `Sr_No`='$srno'";	
	//$sql="INSERT INTO `publication` (`title`, `title1`, `user_date`,`file_path`, `file_flag`, `sys_date`) VALUES ('$title','$title1','$dp1','$fname1','Y',NOW())";	

//echo $sql;
mysqli_query($GLOBALS["___mysqli_ston"], "SET NAMES utf8");
$res=mysqli_query($GLOBALS["___mysqli_ston"], $sql) or die("Error message". mysqli_errno($GLOBALS["___mysqli_ston"]));
echo '<script>
alert("Documents Uploaded..!!!");
window.location.href="update_publication.php"</script>';

?>
