Ahora lo tengo asi dentro del archivo de loguin
Código PHP:
Ver original<?php
/* start the session */
$host_db = "localhost";
$user_db = "root";
$pass_db = "dmrx921";
$db_name = "despliegate";
$tbl_name = "usuarios";
// Connect to server and select databse.
mysql_connect("$host_db", "$user_db", "$pass_db")or
die("Cannot Connect to Data Base.");
$id_usuario = "sin loguear";
// sent from form
$username = $_POST['email'];
$password = $_POST['contrasena'];
$id_usuario = $sql = "SELECT id_usuario FROM `usuarios` WHERE email = '$username'";
$sql= "SELECT * FROM $tbl_name WHERE email = '$username' and contrasena='$password'";
// counting table row
// If result matched $username and $password
if($count == 1){
$_SESSION['loggedin'] = true;
$_SESSION['email'] = $username;
$_SESSION['start'] = time(); $_SESSION['expire'] = $_SESSION['start'] + (60 * 60) ;
header('Location: index2.php'); }
else {
echo "<br/>Email o contraseña estan incorrectos.<br>";
echo "<a href='index.php'>Volver a Intentarlo</a>";
}
?>
y me da el siguiente error
Notice: Undefined variable: id_usuario in C:\xampp\htdocs\paginas\prueba\index2.php on line 7
Haber si alguien me puede decir que hago mal...