Alright, it's pretty simple, I'm trying to make a login script that checks $_POST['username'] and $_POST['password'] and make sure they both correspond to what the DB has stored. So far I have:
Just trying to get it to work, so it doesn't do anything complicated if the script completes, it just says Authentication complete, or rather, supposed to say it.PHP Code:<?php
require ('config.php');
?>
<html>
<table width="195" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="64" height="24">Username:</td>
<td width="131"><form name="form1" method="post" action="">
<input name="username" type="text" id="username">
</form></td>
</tr>
<tr>
<td>Password:</td>
<td><form name="form2" method="post" action="">
<input name="password" type="password" id="password">
</td>
</tr>
</table>
<br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</form>
<?php
if ($submit) {
$md5pass = md5($_POST['password']);
$connect = mysql_connect("$server", "$user", "$pass");
mysql_select_db("$db",$connect) or die('Connection Failed');
$sql = 'SELECT * FROM users';
$result = mysql_query($sql, $connection) or die(mysql_error());
$users=mysql_fetch_row($result);
if (($users[0]=$_POST['username']) AND ($users[1]=$md5pass))
{
echo 'Authentication Complete';
} else {
echo 'Authentication Incomplete';
}
}
?>
However, http://artofstealth.net/login.php is where the script is, and it does nothing. Anyone want to help me out?




Bookmarks