Hello PHP Builder community, as this is my first post I will get straight down to business by saying hello! Now on to further matters.
I've incredibly new to the PHP language having just started using tutorials to guide my path to righteousness! Upon testing the specific PHP page I get this error
Parse error: syntax error, unexpected T_ELSE in /home/morethan/public_html/lt/login.php on line 37
And of course the code for this page
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if ($username&&$password)
{
$connect = mysql_connect("localhost","blank","blank") or die ("Could not connect");
mysql_select_db("morethan_test") or die ("Database not found");
$query = mysql_query("SELECT * FROM phplogin WHERE username='$username'");
$numrows = mysql_num_rows($query);
if ($numrows!==0)
{
while ($row = mysql_fetch_assoc($query))
{
$dbusername = $row['username'];
$dbpassword = $row['password'];
}
// check to see if they match
if ($username==$dbusername&&password==$dbpassword)
{
echo "You're in!";
}
else
echo "Incorrect Password!";
}
else
die("That user does not exist!");
else
die("Please enter a Username and Password");
?>
Note that the original text marked as "Blank" have been replaced for my own security
Kind Regards
Cody