Guest Server Geek Posted May 15, 2006 Share Posted May 15, 2006 Hello Iam hauntmisery and im new to the forums here but i come in peace! hehe.. i need some opions on how to do this. Iam coding a site where i would like to show the user where the last logged in IP was form. Now i could do this with the REMOTE_ADDR fuctions i know that. But its how to get the last logged in to show insted of the 1 that just logged in! Could i use the time fuction to make this work? Thanks for being so nice!Hauntmisery Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted May 15, 2006 Share Posted May 15, 2006 You might have to rephrase your question -- but here goes.Your question: I want the website to remember who a particular IP address last logged in as, and print that when the IP address returns to log in again.options:1. you would need some kind of database / text file to remember who logged in using what IP.2. you could assume that the same IP address is most likely the same computer and just set a cookie or session variable. Quote Link to comment Share on other sites More sharing options...
Guest Server Geek Posted May 16, 2006 Share Posted May 16, 2006 no it may not be the same PC so i mean like cPanel dose shows you last ip than when you log back in it shows u ur IP! Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted May 16, 2006 Share Posted May 16, 2006 Okay, assuming you wrote the login: When they log in, you just record their REMOTE_ADDR to the same database you're storing their login and password to. When they log in, the database is going to open their database record to verify password. Once they're verified, just print the REMOTE_ADDR before recording the new login's REMOTE_ADDR. Quote Link to comment Share on other sites More sharing options...
Guest Server Geek Posted May 16, 2006 Share Posted May 16, 2006 but the thing is how? i confused..EDIT: on logout UPDATE users THANKS! Quote Link to comment Share on other sites More sharing options...
Alicia Posted May 17, 2006 Share Posted May 17, 2006 [!--quoteo(post=374298:date=May 16 2006, 10:12 AM:name=Server Geek)--][div class=\'quotetop\']QUOTE(Server Geek @ May 16 2006, 10:12 AM) [snapback]374298[/snapback][/div][div class=\'quotemain\'][!--quotec--]but the thing is how? i confused..EDIT: on logout UPDATE users THANKS![/quote]actually it is pretty simple.. what u need to do is insert a column in db for the ip and update the record everytime username and password matched...// verify username and password// record the ip // update the db // create a session Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.