How do I put the title of the HTML page according to the user name in the database? [closed]

1

Hello, I'm creating a login and registration system, and I want it when the user finishes registering and logging in the first time, the title of the site page is named.

Type like this:

<!DOCTYPE html>
 <html>
 <head>
 <title> <?php echo $nomedapessoa; ?> </title>
 </head>
 <body>
 </body>
 </html>

But I can not do this communication with the database. I need some help from you.

Note: I use PHP.

    
asked by anonymous 16.07.2015 / 14:23

1 answer

2

When you log in to php, register your user name in SESSION. Logged in to php, please do:

<?php
       session_start();
?>
<!DOCTYPE html>
<html>
     <head>
          <title> <?php echo $_SESSION['nomedapessoa']; ?> </title>
     </head>
     <body>
     </body>
 </html>
    
16.07.2015 / 14:39