Well this is what I have so far. I haven't finished the tutorial yet because when it wasn't working I didn't go any further.
Here is the index page
<html>
<form action="login.php" method='POST'>
Username: <input type='text' name='username'><br /> <br />
Password: <input type='password' name='password'><br />
<input type='submit' value='Log in'>
</form>
<p>Not already a member? Click <a href='register.php'>here</a> to register!</p>
</html>
There here is the login.ohp ( this one works great)
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if ($username&&$password)
{
$connect = mysql_connect("localhost", "root", "q9pl8mq") or die("Couldn't connect to server.");
mysql_select_db("phplogin") or die("Database Not Found");
$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 it matches
if($username==$dbusername&&$password==$dbpassword)
{
echo"Login Successfull!";
}
else
echo"Password Incorrect";
}
else
die("Username doesn't exist!");
}
else
die("Please enter your username and password!");
?>
Then the register.php thats NOT working but can't figure out why...
<?php
$submit = $_POST['submit'];
$fullname = strip_tags($_POST['name']);
$username = strip_tags($_POST['user']);
$password = strip_tags($_POST['password']);
$verifypassword = strip_tags($_POST['verifypassword']);
$date = date("Y-m-d");
if ($submit)
{
if($fullname&&$username&&$password&&$verifypassword)
{
password = md5($password);
verifypassword= = md5($verifypassword);
}
else
echo "Please fill in all fields!";
}
?>
<html>
<form action='register.php' method='POST'>
<table>
<tr>
<td>Full Name:</td>
<td><input type='text' name='name'></td>
</tr>
<tr>
<td>Username:</td>
<td><input type='text' name='user'></td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' name='password'></td>
</tr>
<tr>
<td>Verify Password:</td>
<td><input type='password' name='verifypassword'></td>
</tr>
</table>
<p><input type='submit' name='submit' value='Submit'></p>
</form>
</html>
[attachment deleted by admin]