whathappenswhen53
New Member
- Messages
- 2
- Reaction score
- 0
- Points
- 0
Hi everyone,
I have a tiny problem that I need experienced help with.
I searched the net for hours but I couldn't find a solution to this problem.
so consider this as my last ditch effort for a solution.
I get this error message.
Seems simple enough to solve.
However I checked the syntax through and through and no solution.
Here's my PHP coding:
Please, a solution to this problem will give you good karma :redface:.
I have a tiny problem that I need experienced help with.
I searched the net for hours but I couldn't find a solution to this problem.
so consider this as my last ditch effort for a solution.
I get this error message.
Code:
Parse error: syntax error, unexpected T_ELSE in /www/htdocs/login.php on line 26
However I checked the syntax through and through and no solution.
Here's my PHP coding:
PHP:
<?php
$username = $_POST["username"];
$password = $_POST["password"];
if ($username&&$password)
{
$connect = mysql_connect("localhost","username","password") or die ("Couldn't connect!");
mysql_select_db("DB_name") or die ("Couldn't find DB");
$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"];
}
// check to see if they match!
if ($username==$dbusername&&$password==$dbpassword);
{
echo "Your're in!";
}
else
echo "Wrong Password!";
}
else
die("That user doesn't exist!");
}
else
die ("Please enter a username and a password!");
?>
Last edited: