This code on my website doesn't seem to work. It gives an error 500 and the error log in Apache says there is a syntax error. Any advice? I got this code from a YouTube video. Here is the link: https://www.youtube.com/watch?v=Z_uOXYFVqOE&list=PLC89FC77EBA1595F4&index=2
<?php
session_start();
$username = $_POST['username'];
$password = $_POST['password'];
if ($username&&$password)
{
$connect = mysql_connect("192.168.0.17","root","***************") or die ("Unable to connect to MySQL! Contact the admin.");
mysql_select_db("login") or die ("Unable to find to database! Contact the admin.");
$query = mysql_query("SELECT * FROM users WHERE username='$username'");
$numrows = mysql_num_rows($query);
if ($numrows !=0)
{
while ($row = mysql_fetch_assoc($query))
{
$dbusername = $row['username'];
$dbpassword = $row['password'];
}
if ($username==$dbusername&&$password==$dbpassword)
{
echo "Logged in! <a href='membersarea'>click here to enter the members area</a>"
$_SESSION['username']=$dbusername;
}
else
echo "Incorrect username and/or password.";
}
else
die ("Incorrect username and/or password.");
}
else
die ("Please enter a username and password")
?>