Jump to content

login details in each page


bal bal

Recommended Posts

hi

when I logged in, the details (user ID & last loggin in time) should show in each pages... can anyone please help me how can I do this?

I have got login page with user name and password. when I logged in, it shows the details in the in each pages untill I logged out.

can anyone please help to how can I do this?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/149328-login-details-in-each-page/
Share on other sites

If you're trying to display those details on each page, you could use an include on each page to display these details.

 

<?php
// Your database connection info, session setup,
// and etc. goes here.

$userid = $_SESSION['id']; // Or however you retrieve it.
$data = mysql_fetch_assoc(mysql_query("SELECT * FROM table WHERE id='" . $userid . "'"));

echo "Hello, " . $data['username'] . "!  Your last login was " . $data['lastlogin'];

?>

 

Then, use include(...) to include that in each page, or incorporate it into something that's already included.

how have you stored these details? What is the login method you used? Is there a database involved, etc. etc.

i've got a table called log_dtls where it stores the user name and password. what I want is, when I logged in, it should show the user name and the last login details, like when logged in before. it should like the bank account page, when you logged in your account, it shows your name and when you last logged in....

 

thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.