Good morning, have all of you!
I'm making a user platform and I'm in the profile phase, I've already logged in (which, you enter by registered mail), registration, use of cookies, password forgotten, etc ...
Now, my PHP code for the profile is that it has the TRUE email, otherwise it would show "unregistered user":
<?php include('classes/DB.php');
include('login.php');
$email = "";
if (isset($_GET['email'])){
if(DB::query('SELECT email FROM registroalumnos WHERE email=:email', array(':email'=>$_GET['email']))){
$email = DB::query('SELECT email FROM registroalumnos WHERE email=:email', array(':email'=>$_GET['email']))[0]['email'];
}else {
die('Usuario no encontrado');
}
}
?>
With this code, it takes the email, but apart from taking it, I also want you to take the NAME of the user with that email and it is displayed in:
<h1>Perfil de <?php echo $name; ?></h1>
In my database it is saved in "name". What else should be added in the code to show the name?
PS: I still do not apply JS, I'm in the functionality. Thanks.