Hello colleagues, I need to be able to hide the information that you sent by URL. I have searched for codes that help me do it but I have not had good results. The code is:
<?php
include("obtenerdatos.php");
$user=$_POST['usuario'];
$pass=$_POST['contrasena'];
$ok = 0;
$objeto = new SQLConector;
$lista = $objeto->MostrarUsuario();
for($i =0; $i<count($lista); $i++){
if($user==$lista[$i]['usuario'] and $pass==$lista[$i]['password']){
$ok=1;
header("Location:bienvenido.php?user=".$user);
}
}
if ($ok==0){
header("Location:invalido.php");
}
?>
What I want to hide is the redirection to header("Location:welcome.php?user=".$user) since I sent information to that file and it is seen in the URL. Any help will be useful Greetings.
If you want to hide the user don't send the data through the url, you can use a session to store the user variable, and retrieve it in your welcome.php page , something like this:
And in your welcome.php page you can retrieve it as follows: