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
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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.