Hi
The below code is giving me some greif, when I use my form to post the info the code appears to do nothing, behaves like there is something missing from my php code
any help is great
[code=php]
<?php session_start(); ?>
<html>
<head>
<title>Secure Login Page</title>
</head>
<body>
<?
include ‘db.php’;
// Conver to simple variables
$username = $_POST[‘username’];
$password = $_POST[‘password’];
if((!$username) || (!$password)){
echo “Please enter ALL of the information! <br />”;
include ‘form_user_login.php’;
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[‘first_name’] = $first_name;
$_SESSION[‘last_name’] = $last_name;
$_SESSION[’email_address’] = $email_address;
$_SESSION[‘user_level’] = $user_level;
$_SESSION[‘username’] = $username;
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’;
}
?>
<p><a href=”user_logout.php”>logout</a></p>
<p><a href=”all_database_enteries.php”>My Iformation</a></p>
<p><a href=”viewmyinfo.php”>Get My Info</a></p>
</body>
</html>