I'm making a login script in PHP, but I get an error.
Here is the segment of Code (it is on the line with the echo command):
if(mysql_num_rows($query) == 1)
{
$row = mysql_fetch_assoc($query); //gets value of each field
$_SESSION['id'] = $row['id']; //creates first session var
$_SESSION['username'] = $row['username']; //second session var
echo "<script type="text/javascript">window.location="home.php"</script>";
}
Here is the segment of Code (it is on the line with the echo command):
if(mysql_num_rows($query) == 1)
{
$row = mysql_fetch_assoc($query); //gets value of each field
$_SESSION['id'] = $row['id']; //creates first session var
$_SESSION['username'] = $row['username']; //second session var
echo "<script type="text/javascript">window.location="home.php"</script>";
}