Forum Moderators: open

Message Too Old, No Replies

script for one click

         

pstlw

5:21 pm on Jan 27, 2006 (gmt 0)



I am looking for a script that will disable a link after the first click for 24 hours and if click again by the same person within that 24 hours then redirect to another page. Can someone help? Thank you

Dijkgraaf

9:56 pm on Jan 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How reliable do you want this to be?
The only way I can think to do this with JavaScript is to set a cookie, and have the receiving page check for the existence of that cookie and redirect.
However this isn't 100% reliable as browsers can be configured to reject cookies.

A more reliable way would be to get the user to log in, and record the time of their visit (in a database for example) and use a scripting language such as ASP, PHP or similar to do the work. If you have access to those you could easily do such tricks.