472,356 Members | 1,556 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,356 software developers and data experts.

How to store login time and logout time for every user?

127 100+
i wnat to store the login time and logout time in the database....

plz help... also how to retrieve stored logiin.logout times from database....

when i use the simple time disply
Expand|Select|Wrap|Line Numbers
  1. $t=time();
  2. echo ($t);
i get result as
Expand|Select|Wrap|Line Numbers
  1. time 1287032030 
i want to display the time in a correct format like 10:58 AM ... how to do it plz help
Oct 14 '10 #1
3 8290
you can use session variable to store timings
Oct 15 '10 #2
1,044 Expert 1GB
No idea what ~sathishauit is trying to say, but I'd ignore it if I were you. lol

Anyway, it seems like you already know how to store the time, so what you need to be able to do now is to display it. Use the date() function to display the date in the format that you want.
Oct 15 '10 #3
107 100+
you can create a table with column ip,time, type
ip is the user's ip
time is the time for login or logout time
type is 0 for login time and 1 for logout time

after login user , you can write a record in above table
user's ip is inside $_SERVER['REMOTE_ADDR'], current time is in time(), type depend on login or logout process

for logout you can a menu for logout or can use jquery and write a record in above table with type=1
current time an user's ip

be successful
Oct 16 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

by: MLH | last post by:
I have tblMemberLogins with and fields. Any member may appear in the table numerous times. How can I sum up the total time spent logged in by any member in the table, I can extract the records...
by: Joey Lee | last post by:
Hi, Does anyone knows how to control user login that only a single userid can login at a time? Thanks Joey
by: G | last post by:
Hello Friends, Can i find any sample free webbased-application for employee login and logout timing. Thanks in Advance Appreciate for your Help. Thanks G
by: G | last post by:
Hello Friends, Can i find any sample free webbased-application for employee login and logout timing. Thanks in Advance Appreciate for your Help. Thanks G
by: onlymukti4u | last post by:
Hi All, Can anyone help me out to get the code for knowing the login and logout time difference between some pages. What exactly I want is...."I have a small project having 5 pages,once the...
by: donaldmazig | last post by:
Hello, I am currently working in a database with user security level. What I want to add is a field in a form with type memo where all the user's name, login and logout date and time are recorded....
by: tariquetuku | last post by:
How to create a login and logout link in a php page which will affect the session variable? Any code available?
by: Thiago Macedo | last post by:
I could not find on the web a complete solution for this task. This is not the perfect solution, because it's doesn't have the ability to log the logout if browser crash or user leave it open while...
by: aajayaprakash | last post by:
<?php if($_GET) { $time_now=mktime(date('h')+5,date('i')+30); $a=date('h:i:s',$time_now); echo $b=date(m."/".d."/".Y); include("dbc.php");...
by: naveenkongati | last post by:
Hi, My application is designed under MVC2 architecture which includes JSP,Servlet,DAO and bean. In this application i am tracking a user login details into a table. When user logs out i am...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.