Hi,
The problem that I am having, is that no matter what I put the in the user textbox and password textbox, it always uses the same user? Here is a sample of what I am doing:
<?
If ($login)
{
If(!(mysql_pconnect("localhost", "user", "password")))
{
ErrorString("The Connection To The Database Failed!\n");
}
If(!(mysql_select_db("dbname")))
{
ErrorString("Could Not Select Database");
}
$sql = "select * from users where user='$username' and password='$password'";
If (!$result = mysql_query($sql))
{
ErrorString("could not execute query");
}
# Check the user against the database
If (!$row = mysql_fetch_array($result))
{
ErrorString("Could not fetch array");
}
If (($username = $row["user"]) && ($password = $row["password"]) && $password != "")
{
echo "user $username exists<br>";
echo $sql;
exit();
}
Else
{
echo "user $username doesn't exist<br>";
echo $sql;
exit();
}
}
?>
Here is the code for the form which is method of post and action of $PHP_SELF
<tr>
<td colspan="2" height="3"><font color="#000000" face="<?php echo $font_face; ?>" size="2">User Name</font><br><input type="text" name="username" size="15" maxlength="32"></td>
</tr>
<tr>
<td colspan="2" height="2"><font color="#000000" face="<?php echo $font_face; ?>" size="2">Password</font><br><input type="password" name="password" size=15 maxlength="32"></td>
</tr>