Kryptos
prjRev.com
For the past few hours I have been following a tutorial on how to make a login system.
I'm done now, but it seems there's a problem with line 18 of my login.php.
I've checked if there was any errors, but I couldn't find any.
Here's the code:
Thats the login.php, if you didn't find any errors, I also have members.php, logout.php and index.php. So please help! ;p
If you need to see the error then just tell me and I'll put up a demo.
Thanks - Kryptos
I'm done now, but it seems there's a problem with line 18 of my login.php.
I've checked if there was any errors, but I couldn't find any.
Here's the code:
PHP:
<?php
session_start();
$username = $_POST['username'];
$password = $_POST['password'];
if ($username && $passsword)
{
$connect = mysql_connect("localhost","root","3") or die("Couldn't connect!!");
mysql_select_db("phplogin") 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 "You're in! <a href='member.php'>Click</a> here to enter the member page.";
$_SESSION['username]==$username;
}
else
*** echo "Incorrect password!
}
else
die("That user doesn't exist!");
echo $numrows;
}
else
die("Please enter a username and a password");
*
?>
If you need to see the error then just tell me and I'll put up a demo.
Thanks - Kryptos