before i ask my question, ill give u some background on what im doing
i have a site (duh) and i have a header.php file, the accual page, and then a footer.php file. I built a login/register system off a tutorial, and it all works fine, but
in the login page, everything works perfect until i accually include the header file, so like:
this works:
Code: Select all
<?
//include 'header.php';
/* Check User Script */
$user="ne0";
$password2="****";
$database="db1";
mysql_connect(localhost,$user,$password2);
@mysql_select_db($database) or die("Unable to select database");
// Conver to simple variables
$username = $_POST['username'];
$password = $_POST['password'];
if((!$username) || (!$password)){
echo "Please enter ALL of the information! <br />";
include 'login_form.html';
exit();
}
// Convert password to md5 hash
$password = md5($password);
// check if the user info validates the db
$sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
// Register some session variables!
session_register('first_name');
$_SESSION['first_name'] = $username;
session_register('email_address');
$_SESSION['email_address'] = $email_address;
session_register('special_user');
$_SESSION['user_level'] = $user_level;
mysql_query("UPDATE users SET last_login=now() WHERE userid='$userid'");
header("Location: login_success.php");
}
} else {
echo "You could not be logged in! Either the username and password do not match or you have not validated your membership!<br />
Please try again!<br />";
include 'login_form.html';
}
?>please help if u can, thanks
-Ne0