/    Sign up×
Community /Pin to ProfileBookmark

i was wondering if there’s a way to time how long a person is on my site with a click from a start button and then at the end they will click a submit bottom which will send me an e-mail with how long they were on the site.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyDec 10.2005 — well you can echo the start time into a hidden field in the form, and then when they submit the form check the current time and minus the time posted, resulting in the time on the page
Copy linkTweet thisAlerts:
@MastaAzumarekauthorDec 10.2005 — well... im completely new at this... how would i make that into code?
Copy linkTweet thisAlerts:
@phpmyborderDec 10.2005 — You may also use a session to keep the time

eg. $_SESSION['start'] = microsecond(); //or time()

This will remember when your visitor loaded the page....
Copy linkTweet thisAlerts:
@MastaAzumarekauthorDec 11.2005 — im at a state where i have no clue about php... plz post something that would be for a complete newb... i only know really basic stuff and I've tried learning it... i just can't seem to figure it out...
×

Success!

Help @MastaAzumarek spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...