- <?php
-
-
include("connect.php");
-
include("dbaselevel.php");
-
-
session_start();
-
-
$username = $_POST['username'];
-
$password = $_POST['password'];
-
-
if ($username&&$password)
-
{
-
echo("checking username and password");
-
$open_data = connect_dbase("login");
-
-
$query = mysql_query("SELECT * FROM users WHERE userid = '$username'");
-
$rows = mysql_numrows($query);
-
-
echo($rows);
-
-
if ($rows!=0)
-
{
-
while ($dbrows = mysql_fetch_assoc($query))
-
{
-
$dbusername = $dbrows['userid'];
-
$dbpassword = $dbrows['password'];
-
}
-
if ($username==$dbusername&&$password==$dbpassword)
-
{
-
$_session['username']=$username;
-
$dblevel = mysql_query("SELECT 'level' FROM users WHERE userid = '$username'");
-
$return_level = dbase_level_check($dblevel);
-
$echo ($username. "you're in at". $dblevel);
-
//header("location: {$return_level}");
-
exit();
-
}
-
else
-
die("incorrect login information");
-
}
-
else
-
die("Username does not exist!");
-
}
-
else
-
die("Please enter Username and Password");
-
?>
I am building a database driven website, and this is the login.php file that I have written to access a users database.
it dies as soon as it checks to see if the user's name and password are correct. I am using a directory structure on my server (SME 7.4) that looks like this
HTML/includes
the includes directory holds all of my PHP files and is called from my index.html file through a simple HTML login form. The login form calls login.php, and the address bar, in the browser, shows that it is at least looking for the file, but no output.
I am stumped.