Sorry for the inconvenience, but I have a great doubt, I get an error when showing the data of the logged in user, the strange thing is that if you allow me to enter the moment I enter the username and password.
I have a file login.php .
<?php
require_once("clase/conexion.php");
if(
isset($_REQUEST["user"]) &&
isset($_REQUEST["pass"])
){
$query = $mysqli->query("
SELECT * FROM admin
WHERE usuario = '".$_REQUEST["user"]."'AND
password = '".$_REQUEST["pass"]."'
");
$con = $query->fetch_assoc();
if(
$_REQUEST["user"] == $con["usuario"] &&
$_REQUEST["pass"] == $con["password"]
){
session_start();
$_SESSION["user"] = $con["usuario"];
$_SESSION["pass"] = $con["password"];
header("Location: inicio.php");
}
}
?>
and a view where I print the name of the user that is logged in home.php
<?php echo $_SESSION["usuario"]; ?>
and I get this error, telling me that in the view where I print the user's name is undefined which would be $ _ SESSION ["user"] .
Undefined index: user in C: \ wamp64 \ www ..