Hi,
I am sorry to keep posting, but I am still not getting the correct results and don't know what else to do. Here is my current code:
<?php
require_once("includes/config.inc");
$loggedin = "False";
if ($HTTP_POST_VARS["username"] != null) {
$user = $HTTP_POST_VARS["username"];
$passwd = $HTTP_POST_VARS["password"];
$query = "SELECT Username, Visited, User_PK from wefx where Username = $user and Password = PASSWORD('$passwd')";
$db_query = mysql_query($query, $db_connection);
$row = @mysql_fetch_row($db_query);
$num_results = @mysql_num_rows($db_query);
if ($num_results == 1) {
if ($row[2] == 1) {
$loggedin = "True";
header("Location: index.html");
} else {
if ($row[1] == 0) {
$loggedin = "True";
$index = $row[2];
$query = "update wefx set Visited = 1 where User_PK = $index";
$result = @mysql_query($query, $db_connection);
header("Location: index.html");
} else {
echo("<font color=\"red\">Access expired.</font>");
}
}
} else {
echo("<font color=\"red\">Username and/or password are incorrect.</font>");
}
}
?>
Can you see anywhere else that I am still messing up at? I only have one user currently in my database and I am not able to log in with that user. As I said I am sorry to keep posting but I am at a loss.
Thank you