It says it not there.... 404 Error?!?! !@$#@%@$#
Posted: Mon Feb 10, 2003 5:45 pm
I have been working on my website and after updating the login i started to get some really maddening responses.
Now when i log in it logs in and sets the SESSION variables but when it gets to the header("Location: " . $HTTP_REFERER); it brings up a 404 page not found ... heres the code... it seems to bring up the error on a couple of pages...
.... Any Suggestions?
Now when i log in it logs in and sets the SESSION variables but when it gets to the header("Location: " . $HTTP_REFERER); it brings up a 404 page not found ... heres the code... it seems to bring up the error on a couple of pages...
Code: Select all
<?php session_start();
// ********************PAGE VARIABLES******************
$waldo = "../";
// ****************************************************
if (isset($_POSTї'user']) && isset($_POSTї'pass'])){
// Get Login Information
$user_name = addslashes($_POSTї'user']);
$password = addslashes($_POSTї'pass']);
// **** QUERY ****
$query = "SELECT * FROM users WHERE user_username = '$user_name' AND user_pass = SHA1('$password')";
$result = @mysql_query($query, $connection) or die ( header ("Location: " . $waldo . "Error.php" ) );
$affected_rows = @mysql_num_rows($result);
if (@mysql_num_rows($result) > 0) {
while ($row = @mysql_fetch_array($result)) {
$_SESSIONї'VAL'] = $rowї'user_uniId'];
$cartId = $rowї'user_cartId'];
$_SESSIONї'USER'] = $user_name;
if (!isset($_SESSIONї'CART'])) {
$_SESSIONї'CART'] = $cartId;
} else {
// Change temp cart contents to new cart id.
$query = "UPDATE cart SET cart_cartId = '$cartId' WHERE cart_cartId = '" . $_SESSIONї'CART'] . "'";
$result = @mysql_query($query, $connection) or die ( header ("Location: " . $waldo . "Error.php" ) );
// Set new cart id
$_SESSIONї'CART'] = $cartId;
} // if preset cart
$date = date("Y-m-d");
$ipAdd = $_SERVERї'REMOTE_ADDR'];
$browser = $_SERVERї'HTTP_USER_AGENT'];
$query = "INSERT INTO log (log_id, log_user, log_ip, log_date, log_browser) VALUES (NULL, '$user_name', '$ipAdd', NULL, '$browser')";
$result = @mysql_query($query, $connection) or die ( header ("Location: " . $waldo . "Error.php" ) );
$query = "UPDATE users SET user_lastlog = '$date' WHERE user_username = '" . $_SESSIONї'USER'] . "' AND user_uniId = '". $_SESSIONї'VAL'] ."'";
$result = @mysql_query($query, $connection) or die ( header ("Location: " . $waldo . "Error.php" ) );
header("Location: " . $HTTP_REFERER);
exit;
}
} else {
$loginPass = false;
}
}