This is a discussion on Track User information within the PHP Programming forums, part of the Web Development category; Hi Guys, I want to track the user's login and logout time by storing values into DB for showing ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi Guys, I want to track the user's login and logout time by storing values into DB for showing the user status. While clicking signout properly, then no problems for me to track. When the window is closed due to various reasons, is there any chance to track in either Javascript or PHP? and while changing the url other than my sites also get tracking. This will help me to complete my tasks
__________________ With, J. Jeyaseelan Everything Possible |
| Sponsored Links |
| |||
| Hi guys, I have forgotton to mention one more things regards tracking user information. is there any possibilities to track from the server configuration? i mean the sessions information are stored into the web server. is there any chance to track the session id which not properly closed by the user?
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Hi Jeyaseelansarc You are tracking the user login and logout on your tracking system thats fine. My suggestion is update the member’s last transaction time on your tracking system. When you need to show the member status, compare this last transaction and logout time with current time then you can identify the status (active or idle)Is this helpful? Thanks -Kathir |
| |||
| Hi Kathir, Thank you for the answer. As u said each and every time we track entire page and update the transaction date. It will work fine. I will try with this way and let u know u after
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Hi, we can make use java script events, in the body element(unload event) we can write ajax code which updated the status in the current user in the unload event. if u found any good solution, please post it. Regards, Vivekanandan |
| |||
| Hi, thanks for replying. I have thought of solution to track the user's online as follows 1. In body onload call a function to track the every transaction user makes on ur site. 2. While checking user's online checking for proper logout time, if exists then the user should be offline. if not then get transaction date and compare with current date if the difference exceed the limit u fixed, then user should be out of ur site, then u came to know that the user is offline. I have to follow these steps. Is there any change needed?
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| hi..... if user closed the browser the unload event will not help you to track the user..because if u referesh the page also unload event will fire.. Below code is helpful to track the user while closing the browser I have done the user tracking by .. <script language="JavaScript"> <!-- function closeWindow(evt) { var e = (window.event) ? window.event : evt; if (e.clientX < 0 && e.clientY < 0) { (new Image()).src="logout.php?value=0"; alert("logout") } return true; } // --> </script> </head> <body onunload="closeWindow(event)" > but it works only in IE...not FF Last edited by kingmaker : 08-03-2007 at 05:01 AM. |
| |||
| hi, i have already tried this! As you said it is working fine on IE while close the browse window, but when i have tested for this while the user click browser back button, it does not support. But i need to support both the browser (IE and FF) Another issue for this is when the user change the url from address bar then how can we track the user login?
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| hi Jeyaseelan, Yes, to solve out this problem you need to update the time whenever the page gets navigated. From the last navigated time you can compare the time with the current time. If the duration exceeds the time u fixed, then the user might have closed page or the session might have expired. From this you can check whether the user is online or the logout time.
__________________ None of us is As Strong as All of us. |
| |||
| Hi Anand, Thanks for your reply. I have already done the same way which you have given here. This is working fine now. But if we have the better solution to track online and offline users, thats helping us. Using ajax call i am storing the transaction date in DB.
__________________ With, J. Jeyaseelan Everything Possible |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do you track your website visitors? | montyauto | PHP Programming | 3 | 09-11-2007 03:25 AM |
| store information about user’s locale | prasath | ASP and ASP.NET Programming | 1 | 08-18-2007 12:58 AM |
| How to track IPs of clients while requesting page | sureshbabu | PHP Programming | 2 | 07-20-2007 08:27 AM |
| Track the mobile user | prasath | Mobile Software Development | 0 | 07-16-2007 05:54 AM |
| How can track click? | webmaster | Search Engine Optimization | 1 | 02-20-2007 04:05 AM |