It is showing following error on execution of my program Parse error: syntax error, unexpected T_VARIABLE in /home/sanganak/public_html/dwarka_parichay_copy/add.php on line 18 my program code is following <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $con = mysql_connect("localhost","sanganak_manish","manish"); if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("sanganak_mydata",$con); $s = $_POST['name'] $p="mohan"; echo $s; echo $p; if($s == $p) { header('Location:http://sanganak.co.in/dwarka_parichay_copy/useful_links.htm'); } mysql_close($con) ?> </body> </html> Please solve my error in code. Thanks.
Replace it with You forgot the ; <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $con = mysql_connect("localhost","sanganak_manish","manish"); if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("sanganak_mydata",$con); $s = $_POST['name']; $p="mohan"; echo $s; echo $p; if($s == $p) { header('Location:http://sanganak.co.in/dwarka_paricha...nks.htm'); } mysql_close($con) ?> </body> </html> PHP:
yourihost is right. The line that was messed up was $s = $_POST['name'] it should be $s = $_POST['name'];