Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Refer to friend & count time on page?
Old 08-18-2008, 07:32 AM Refer to friend & count time on page?
Spud In Disguise's Avatar
Super Spam Talker

Posts: 808
Location: UK... where else?
Trades: 0
Hey guys, I was wondering if I might be able to get some help. I need to design a system the allows visitors to my site to send a recommendation email to their friends. The email should provide a link back to the site which times how long they spend on the page, and allows the person who sent the original email to access this statistic.

I imagine the person sending the email will be given a code that they can enter to track each individual email sent, rather than signing up to the site and having everything saved in a profile.

Is this a difficult thing to create? I have very little knowledge of coding PHP - I have used it a lot in CMS's, but I've never really coded anything from scratch.
__________________

Please login or register to view this content. Registration is FREE
- Fansite

Please login or register to view this content. Registration is FREE
- Blog
Spud In Disguise is offline
Reply With Quote
View Public Profile Visit Spud In Disguise's homepage!
 
 
Register now for full access!
Old 08-18-2008, 10:15 AM Re: Refer to friend & count time on page?
Skilled Talker

Posts: 61
Trades: 0
I have found that from experience people don't use those "click here to send to a friend" link. If they really like your website they will send it on their own with their email client or through IM. That being said... if you really want to go forward with it it's not very hard to create using php's mail() function.

Personally, I wouldn't bother but that's just me.

Pod.
just_a_pod is offline
Reply With Quote
View Public Profile
 
Old 08-18-2008, 05:22 PM Re: Refer to friend & count time on page?
Spud In Disguise's Avatar
Super Spam Talker

Posts: 808
Location: UK... where else?
Trades: 0
I realise that, but it's an important feature in my site, so I would really like to do this.

Would your suggestion cover the time counter too?
__________________

Please login or register to view this content. Registration is FREE
- Fansite

Please login or register to view this content. Registration is FREE
- Blog
Spud In Disguise is offline
Reply With Quote
View Public Profile Visit Spud In Disguise's homepage!
 
Old 08-18-2008, 09:34 PM Re: Refer to friend & count time on page?
Extreme Talker

Posts: 177
Trades: 0
For the time counter I would put a hidden input into the form that has the current time when the page loads, then when the submit button is pressed get the time of that. Then you'll know how long the page was loaded.

PHP Code:
<input type="hidden" value="<?php echo time();?>">
kbfirebreather is offline
Reply With Quote
View Public Profile
 
Old 08-19-2008, 03:06 AM Re: Refer to friend & count time on page?
Spud In Disguise's Avatar
Super Spam Talker

Posts: 808
Location: UK... where else?
Trades: 0
Which submit button is that?

Will that method give an accurate display of the time actually spent on the page, or just when they first loaded it?
__________________

Please login or register to view this content. Registration is FREE
- Fansite

Please login or register to view this content. Registration is FREE
- Blog
Spud In Disguise is offline
Reply With Quote
View Public Profile Visit Spud In Disguise's homepage!
 
Old 08-19-2008, 03:20 AM Re: Refer to friend & count time on page?
Average Talker

Posts: 16
Trades: 0
kbfirebreather's suggestion is almost there. It wouldn't work if the user keeps refreshing the page (The time will refresh as well).
I think you will need a session object to keep track.
PHP Code:
if(!isset($_SESSION['start-time'])){
$_SESSION['start_time'] = time();

Then on submit
PHP Code:
$duration time() - $_SESSION['start_time'];
unset(
$_SESSION['start_time']); 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


netraits is offline
Reply With Quote
View Public Profile Visit netraits's homepage!
 
Old 08-19-2008, 03:41 AM Re: Refer to friend & count time on page?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
In this case the cookie with time value will be quite enough
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 08-19-2008, 01:35 PM Re: Refer to friend & count time on page?
Spud In Disguise's Avatar
Super Spam Talker

Posts: 808
Location: UK... where else?
Trades: 0
I see ok... well I'm gonna need a bit of help putting it all together... So what's the first step, get a referral system ready?
__________________

Please login or register to view this content. Registration is FREE
- Fansite

Please login or register to view this content. Registration is FREE
- Blog
Spud In Disguise is offline
Reply With Quote
View Public Profile Visit Spud In Disguise's homepage!
 
Reply     « Reply to Refer to friend & count time on page?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29506 seconds with 12 queries