Im confused. Why am I unable to execute this code?
Posted: Tue May 27, 2003 9:35 am
I have the following code, which if I try and execute without any <html></html> tags comes back with a 404 error from IIS.
Could anyone point me in the reason why? I'm really confused by this.
Could anyone point me in the reason why? I'm really confused by this.
Code: Select all
<?php
require('config.inc.php');
require('sql.inc.php');
$query = "SELECT id,user,name,pass=PASSWORD('".$_POST["pass"]."') FROM users WHERE user='".$_POST["login"]."' AND pass!=''";
$result = @mysql_query($query, $sql);
if( mysql_num_rows($result) != 1 ) {
header("Location: /main.php?&err=true"); exit;
}
$row = @mysql_fetch_array($result);
if( $row[3] == 0 ) {
header("Location: /main.php?err=pass"); exit;
}
$user_is_logged_in = true;
$user_id = $row["id"];
$user_login = $row["user"];
$user_name = $row["name"];
require('session.inc.php');
session_register("user_id");
session_register("user_login");
session_register("user_name");
session_register("user_is_logged_in");
if(!isset($_GET["uri"]) || $_GET["uri"] == "")
$uri = "/list.php";
else
$uri = $_GET["uri"];
header("Location: $uri");
?>