The following code gives Parse error: syntax error, unexpected T_VARIABLE. on line 8
.
<?php
session_start();
$email=$_REQUEST['email'];
$password=$_REQUEST['password'];
$con=mysqli_connect("localhost","root","","mydb");
if(mysqli_fetch_array(mysqli_query($con,"select*from user101 where
email="$email" and password="$password"")))
{
$_SESSION['email']=$email;
echo "login successful";
header("Location:welcome.php");
}
else
{
echo "Login failed";
}
?>