3
I have two tables one for login and password and another where are the user data, as address, phone, etc..
After logging in would that the data displayed on the screen were not the login and yes the name of the person, with telephone address.
The session code is this, I’m using two table in mysql.
session_start();
$message="";
if(count($_POST)>0) {
$conn = mysql_connect("localhost","root","");
mysql_select_db("users",$conn);
$result = mysql_query("SELECT * FROM users WHERE user_name='" .
$_POST["user_name"] . "' and password = '". $_POST["password"]."'");
$row = mysql_fetch_array($result);
if(is_array($row)) {
$_SESSION["user_id"] = $row[user_id];
$_SESSION["user_name"] = $row[user_name];
} else {
$message = "Login e Senha Invalidos!";
}
}
if(isset($_SESSION["user_id"])) {
header("Location:painelcontrol.php");
}
?>