Re: [PHP] OT but need guidance in timing page views
Stephen Sadowski wrote: It seems like alot of people are focusing on what you can't do. As the client seems not to care, you could take the immediate approach and mimic several other online education sites, combining JavaScript to monitor the browsing habits and submitting a php script when the page is left. The problem with all this is that you will prevent the honest students from cheating but not the ones who want to cheat. Sure, not entirely accurate, and you can still fool it if you have the know-how, -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
On Tuesday 20 July 2004 05:41, Stephen Sadowski wrote: > It seems like alot of people are focusing on what you can't do. Doing something which is plainly pointless seems dubious practice. > As the client seems not to care The client needs education. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The best way to accelerate a Macintoy is at 9.8 meters per second per second. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
> >>I know that this is somewhat off topic, but I just need a starting place > >>to do the research and thought someone here might be able to help. I am > >>developing an application in which I need to time how long a visitor > >>remains within a module and how long they view each page. It seems like alot of people are focusing on what you can't do. As the client seems not to care, you could take the immediate approach and mimic several other online education sites, combining JavaScript to monitor the browsing habits and submitting a php script when the page is left. IE, use onload/onfocus to start a timer, onblur to pause it, and then onunload to perhaps popup or popunder a new window, populate a form with your necessary data, auto-submit and close that window. Sure, not entirely accurate, and you can still fool it if you have the know-how, but much more accurate than refreshing a frame every 2 minutes, and you have control of a timer than can be stopped when the user's not viewing the page. IIRC, there are several 'defensive driving' online sites that use this approach in the US. -SS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
Robb Kerr wrote: On Mon, 19 Jul 2004 08:58:22 -0500, Jay Blanchard wrote: [snip] I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. Is this something that you cannot do with Awstats? you can produce all kinds of different stats including the time spent etc but it's not very accurate but i think oyu are not to concerned about the deviations. The stats would be nearly bogus because of the habits of users. Yeah I leave the computer running with mozilla showing 3-3 different tabs. Let us You are completely correct and I've already considered this issue and discussed it with my client. But, they aren't bothered by the issue. The app is an online education system that provides accredidation and all I really have to verify is that the visitor (student) remained within the module for a minimum amount of time. I know that the student can get around this issue by simply leaving the browser open with one of my pages loaded, but they'll still have to pass an exam at the end of the course. So, if they just leave the page open and don't read the contents, they probably won't be able to pass the test. At least I can report to the accredidation agency that the student had the course open for the required amount of time. A log analyser can still do it for you. though my favourite analyser is analog this is best handled with awstats (IMHO) using the refreshing frame that has already been suggested. PHP shouldn't be needed at all because you don't seem to need real time reporting. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
Hi! This is what you need :) You have hidden frame (FRAME not layer!!!) (it means )... then in check.php would be something like this: $id = $myid; //myid will be stored in session after user logs in Connect to database, pair ID with a row in table and update mytable set endtime = UNIX_TIMESTAMP() where id = myid; do this every 2 minutes (ie with refresh tag set to 120 secs) ... if user changes page, then do following: check, if last refresh (endtime) is less then 2 minutes ago... if so, write the new value as an endtime and set some flag to consider this session closed and then you can count the time... (if some open sessions for this user open) Set new start time for this user and generate new frameset with frame mentioned above... In case, that the difference between current timestamp and last endtime is 2+ minutes, time endtime + 2 minutes will be written as endtime and flags properly set to finished session ... and then start the new one... and so on... i hope i've explained it right :) regards, m. Robb Kerr wrote: On Mon, 19 Jul 2004 15:54:14 +0200, Miroslav Hudak wrote: I would do it this way: - open the page and create hidden iframe (or frame with 0% width/height) which will be refreshing itself every ... let's say ... 2 minutes... then you'll get up to 2 minutes accurate numbers... the refreshed page would write timestamp to database every refresh... when the user crashes or leaves the page without logging off, you know, that his next refresh (and last one) would be LASTREFRESH + 2mins ... that gives you quite accurate numbers when implemented correctly. On the other hand, it will be a bit load producing, while that subsequent writes to database... Hope it helped a bit, regards, m. Robb Kerr wrote: I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. I can create the appropriate fields in MySQL and can use PHP to do the appropriate calcualtions. What I don't know is how I communicate this information to the server. I can use POST or GET statements to pass info with page turns but what do I do if the visitor leaves the site without logging out or experiences a machine crash? Also, if anyone knows of a good javascript newsgroup, please pass along the info. Thanx, Robb Thanx for the suggestion. Now to ask for more help... I know how to create the layer which you mentioned. But, how do I make it auto update every few minutes and send data to the database? Thanx again, Robb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
On Mon, 19 Jul 2004 15:54:14 +0200, Miroslav Hudak wrote: > I would do it this way: > > - open the page and create hidden iframe (or frame with 0% width/height) > which will be refreshing itself every ... let's say ... 2 minutes... > then you'll get up to 2 minutes accurate numbers... the refreshed page > would write timestamp to database every refresh... when the user crashes > or leaves the page without logging off, you know, that his next refresh > (and last one) would be LASTREFRESH + 2mins ... that gives you quite > accurate numbers when implemented correctly. > > On the other hand, it will be a bit load producing, while that > subsequent writes to database... > > Hope it helped a bit, > regards, > m. > > Robb Kerr wrote: > >> I know that this is somewhat off topic, but I just need a starting place to >> do the research and thought someone here might be able to help. I am >> developing an application in which I need to time how long a visitor >> remains within a module and how long they view each page. I can create the >> appropriate fields in MySQL and can use PHP to do the appropriate >> calcualtions. What I don't know is how I communicate this information to >> the server. I can use POST or GET statements to pass info with page turns >> but what do I do if the visitor leaves the site without logging out or >> experiences a machine crash? >> >> Also, if anyone knows of a good javascript newsgroup, please pass along the >> info. >> >> Thanx, >> Robb Thanx for the suggestion. Now to ask for more help... I know how to create the layer which you mentioned. But, how do I make it auto update every few minutes and send data to the database? Thanx again, Robb -- Robb Kerr Digital IGUANA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
On Mon, 19 Jul 2004 08:58:22 -0500, Jay Blanchard wrote: > [snip] > I know that this is somewhat off topic, but I just need a starting place > to do the research and thought someone here might be able to help. I am > developing an application in which I need to time how long a visitor > remains within a module and how long they view each page. I can create > the appropriate fields in MySQL and can use PHP to do the appropriate > calcualtions. What I don't know is how I communicate this information to > the server. I can use POST or GET statements to pass info with page > turns but what do I do if the visitor leaves the site without logging > out or experiences a machine crash? > [/snip] > > The stats would be nearly bogus because of the habits of users. Let us > say that I log in to the app. I have a look at the items on the page, I > get up, go to the bathroom, talk to Bobbi in the hallway, wander back > into my office, grab my coffee cup, go to the coffee machine, visit with > Bob while I am there, realize that it is time for my first meeting, go > back to my office, grab my notebook, head for meeting, arguements and > disagreements abound, meeting takes way longer than expected, return to > office, listen to messages, return calls, people wander in and ask > questions about things, I check e-mails, return a couple. Before you > know it 3 hours have passed before I go back to the browser window with > the app clock running. Not to mention the two things you said above. > > Why is this important? Just curious. You are completely correct and I've already considered this issue and discussed it with my client. But, they aren't bothered by the issue. The app is an online education system that provides accredidation and all I really have to verify is that the visitor (student) remained within the module for a minimum amount of time. I know that the student can get around this issue by simply leaving the browser open with one of my pages loaded, but they'll still have to pass an exam at the end of the course. So, if they just leave the page open and don't read the contents, they probably won't be able to pass the test. At least I can report to the accredidation agency that the student had the course open for the required amount of time. Robb -- Robb Kerr Digital IGUANA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OT but need guidance in timing page views
[snip] I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. I can create the appropriate fields in MySQL and can use PHP to do the appropriate calcualtions. What I don't know is how I communicate this information to the server. I can use POST or GET statements to pass info with page turns but what do I do if the visitor leaves the site without logging out or experiences a machine crash? [/snip] The stats would be nearly bogus because of the habits of users. Let us say that I log in to the app. I have a look at the items on the page, I get up, go to the bathroom, talk to Bobbi in the hallway, wander back into my office, grab my coffee cup, go to the coffee machine, visit with Bob while I am there, realize that it is time for my first meeting, go back to my office, grab my notebook, head for meeting, arguements and disagreements abound, meeting takes way longer than expected, return to office, listen to messages, return calls, people wander in and ask questions about things, I check e-mails, return a couple. Before you know it 3 hours have passed before I go back to the browser window with the app clock running. Not to mention the two things you said above. Why is this important? Just curious. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT but need guidance in timing page views
I would do it this way: - open the page and create hidden iframe (or frame with 0% width/height) which will be refreshing itself every ... let's say ... 2 minutes... then you'll get up to 2 minutes accurate numbers... the refreshed page would write timestamp to database every refresh... when the user crashes or leaves the page without logging off, you know, that his next refresh (and last one) would be LASTREFRESH + 2mins ... that gives you quite accurate numbers when implemented correctly. On the other hand, it will be a bit load producing, while that subsequent writes to database... Hope it helped a bit, regards, m. Robb Kerr wrote: I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. I can create the appropriate fields in MySQL and can use PHP to do the appropriate calcualtions. What I don't know is how I communicate this information to the server. I can use POST or GET statements to pass info with page turns but what do I do if the visitor leaves the site without logging out or experiences a machine crash? Also, if anyone knows of a good javascript newsgroup, please pass along the info. Thanx, Robb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OT but need guidance in timing page views
I know that this is somewhat off topic, but I just need a starting place to do the research and thought someone here might be able to help. I am developing an application in which I need to time how long a visitor remains within a module and how long they view each page. I can create the appropriate fields in MySQL and can use PHP to do the appropriate calcualtions. What I don't know is how I communicate this information to the server. I can use POST or GET statements to pass info with page turns but what do I do if the visitor leaves the site without logging out or experiences a machine crash? Also, if anyone knows of a good javascript newsgroup, please pass along the info. Thanx, Robb -- Robb Kerr Digital IGUANA Helping Digital Artists Achieve their Dreams http://www.digitaliguana.com http://www.cancerreallysucks.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php