![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Bland for life
Industry Role:
Join Date: Nov 2004
Posts: 10,468
|
PHP people...quick question
What's the best way to approach easily creating expiring links?
Links that expire after the first click? Or after a certain amount of clicks or time. Whichever is easier.
__________________
★★★
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Damn Right I Kiss Ass!
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,409
|
And by expire you mean?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Bland for life
Industry Role:
Join Date: Nov 2004
Posts: 10,468
|
1 click. link gone.
__________________
★★★
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
Never tried it but maybe a CSS thing:
a:visited { display: none; } ?
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Bland for life
Industry Role:
Join Date: Nov 2004
Posts: 10,468
|
Quote:
What I want to do is after a potential client visits a page. I don't want them to be able to go to that page again. Unless I send them a fresh link.
__________________
★★★
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
Quote:
<?php // on page being hit if(isset($_COOKIE["alreadyhere"])) { header("Location: /another/uri"); } else { setcookie( "alreadyhere", 1, (time()*100000), $_SERVER["REQUEST_URI"] ); } ?> -- or some shit. basically, store something of the URI they already visited, test and send somewhere else. someone else has a more elegant solution that's bug-checked, so I'll just bump this for ya ![]()
__________________
Your post count means nothing. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Bland for life
Industry Role:
Join Date: Nov 2004
Posts: 10,468
|
Quote:
ill take anything else anyone can throw at me though.
__________________
★★★
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Join Date: Aug 2003
Location: Austin, TX
Posts: 4,090
|
Quote:
if you want to do it with a database, rather than a cookie... in the email, you have an ID like ID=12 that is unique to the person.. or the ID is for a particular URL and after so many incremental clicks, you do something else. when they land on your page, you mark in the database that they visited via the unique ID (so this helps you to confirm they clicked through), and the next time they click through on the email, your database lookup will see they were already there, and then redirect to another URL or display some message. Fight the tips & tricks!
__________________
http://www.t3report.com (where's the traffic?) v5.0 is out! | http://www.FightThePatent.com | ICQ 52741957 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Master of Gfy.com
Industry Role:
Join Date: Feb 2002
Posts: 14,887
|
i am not a php pro by any means, i have my own threads on here asking for help ;) but what if you set a status for the links? on the main page it only shows "active links" and when they click, you have a variable that sets it inactive, thus it wont be shown on the main page anymore after a click. Just an idea
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: Mar 2006
Location: San Diego, CA
Posts: 1,421
|
Do this in a database. Store a unique id for each link sent (i.e. md5($email . time()); ) using the md5 hash prevents people guessing for someone else's link (by incrementing a numeric value like id=5 as suggested above).
In your db table also have a field for date_clicked which you update when the url is loaded. You could also have a campaign_id or something to track multiple links mailed in the same table, maybe the email address as well, whatever suits your needs. Then you send a link like : http://www.someurl.com/somepage.html...23456789abcedf When the link is loaded you check the db for that hash and whether date_clicked has been set or not. Redirect or load the one time link page based on those conditions and then update the db.
__________________
![]() Naughty America - Director of Technology It's a CELEBRATION bitches!! For the hottest content promote Naughty America! ![]() swish at naughtyamerica dot com | ICQ: 226 737 620 | See Who I Am At AdultWhosWho.com! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Bland for life
Industry Role:
Join Date: Nov 2004
Posts: 10,468
|
Thanks Swish and Fight This Patent, I think I'll mesh your two ideas hash + lookup
thanks to you too pipecrew. good to see you still posting around here. hows miami treating you?
__________________
★★★
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Too lazy to set a custom title
Join Date: Mar 2002
Location: Australia
Posts: 17,393
|
If you use hashes then there's a small chance that they will not be unique across two or more messages. Better to generate an array of hashes, weed out any dupes, and then allocate IDs from that.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
The Dirty Frenchman
Industry Role:
Join Date: Nov 2005
Location: Lost Angeles
Posts: 8,904
|
Use PHP's APC Cache.
Put the link URL in a key in apc cache, once it's been accessed, destroy the key. http://us.php.net/apc |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Industry Role:
Join Date: Nov 2007
Posts: 105
|
database + unique hashes is the only sure shot way to go at this.
it what i would do. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Confirmed User
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
|
href="myScript.php?linkID=xxxx"
then the myScript.php redirects and removes the link as a valid option you can probably use a database as the easiest way to keep track of it |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
do you still need this?
i know its a very old thread, but i use something like this, you can make the url expire after certain amount of time. bind it to an ip address, etc.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |