Hello,
I'm a newbie to PHP and MySQL and really need help, here is my problem:
I want to get this form to check the database and then whether the username is right or not send it to a page based on that information. All database information is in "database.php" in the same directory. I want the correct one to be sent to "room1.php" and the wrong one sent to "wrongpass.php." I have a register script all working and know all I need is th elogin-script for the specific file. Here is what it consists of:
<?
/
Connect to the mysql database.
*/
$conn = mysql_connect("localhost", "sythe", "kieran") or die(mysql_error());
mysql_select_db('sythe_users', $conn) or die(mysql_error());
?>
Here is my first attempt:
It's in html:
form action="room1.php" method="post">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30"></td></tr>
<tr><td>Password:</td><td>
1104
<input type="password" name="pass" maxlength="30"></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember">
<font size="2">Remember me next time</td></tr>
<tr><td colspan="2" align="right"><input type="submit" name="sublogin" value="Login"></td></tr>
<tr><td colspan="2" align="left"><a href="register.php">Join</a></td></tr>
</table>
</form>
This however is total rubbish it doesn't matter what username you have it still logs you in if it is bogus or not.
Please help me establish a good login script for my site,
Thanks in advance,
SyTHe
P.S. You can see it action at
http://sythe.hostcubix.com/alpha
or
http://teaminferno.co.nr
Thanks again,
SyTHe