<html>
<body>
<?php include("header.php"); ?>
<?php include("menu.php"); ?>
<?php
$host = 'localhost';
$user = 'root';
$password = '';
$database = 'egov';
$conn = mysql_connect($host,$user,$password) or die('Server Information is not Correct');
mysql_select_db($database,$conn) or die('Database Information is not correct');
$sql = "CREATE TABLE IF NOT EXISTS 'upload'(file_id INT(11) NOT NULL,fName VARCHAR(255) NOT NULL,lName VARCHAR(255) NOT NULL,Mo INT(11) NOT NULL,dese VARCHAR(255) NOT NULL,Email VARCHAR(255) NOT NULL,file_name VARCHAR(255) NOT NULL,PRIMARY KEY(file_id))ENGINE = MYISAM";
if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0)
{
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
$fp = fopen($tmpName, 'r');
$content = fread($fp, filesize($tmpName));
$content = addslashes($content);
fclose($fp);
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
}
$da = date("dmy");
echo $da;
$fname = $_REQUEST['lastname'];
$lname = $_REQUEST['firstname'];
$pno = $_REQUEST['mbo'];
$email = $_REQUEST['email'];
$query = $_REQUEST['description'];
$sql = "INSERT INTO upload (
fName,
lName,
Mo,
dese,
Email
)
VALUES (
'$fname',
'$lname',
'$pno',
'$email',
'$query ',
'file_name',
NOW()
)";
include'index.php';
?>
<?php include("copyrights.php"); ?>
</div>
</div>
</body>
</html>
please some one help me am getting an parse error while inserting data into mysql database through my script
ive also changed its code like to:
?>
still not working... its showing the same error as unexpected ending and thanks in advance ........