hi im new to php and i want to code a admin login page where i want to match the values from the login form with the values of the database table.....when i run the login page after entering the user name and the password i've got a Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\php \validate.php on line 16. Can anybody please help me to slove this matter.
validate.php
validate.php
Code:
<?php
session_start();
$username= $_POST['adminusername'];
$password= $_POST['adminpass'];
$conn= mysql_connect('localhost','root','');
mysql_select_db('onlinestore',$conn);
$query='SELECT * FROM admin WHERE adminusername='$username' and adminpassword='$password'';
$result=mysql_query($query);
if(mysql_num_rows($result)==1)
{
header("location:menu.php");
exit();
}
header("location:adminlogin.php");
exit();
?>
</body>
Comment