Forum Moderators: open

Message Too Old, No Replies

How to make a link disapear after click and let it return after 24 hou

         

techboy992

11:01 am on Feb 15, 2011 (gmt 0)

10+ Year Member



<html> 
<head>
<script type="text/javascript">
function disableLink(url) {
document.write("<style type='text/css'>.disLink {display:none;}</style>");
location.href = url;
}
</script>
</head>
<body>
<a href="javascript:disableLink('http://www.example.com');" class="disLink">test</a>
</body>
</html>


This script I found in another thread, it works fine but the link is diabled for good, is possible to let only be diabled for 24 hours.

I will be glad if someone could help, It will be used in a click system to click adds.

Regards
Brian Olsen

techboy992

11:10 am on Feb 15, 2011 (gmt 0)

10+ Year Member



and make the link to open in new window

londrum

11:30 am on Feb 15, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



when they click the link give them a cookie. then just check for the existance of the cookie, and if its there write the CSS to the page.

if you make the cookie expire after 24 hours then the link should reappear.

...but if the URL that the link is pointing to is not on the same site then it wont work, because you wont be able to give them the cookie at the other end. maybe you could first send the link through a redirect URL instead, which you do control?

techboy992

12:07 pm on Feb 15, 2011 (gmt 0)

10+ Year Member



maybe send to a redirecting page that set the coccie but how to then update the clclick site after a click ?

The user get a site with alot lot of link in one page, then clicked the link shall disapeer so alwayes what link in the row he / she clicked already.

techboy992

12:10 pm on Feb 15, 2011 (gmt 0)

10+ Year Member



hmmm try again that was not good explained!

The user get a site with alot of link then she have click one of the link that link shall be hidden, so he / she alwayes know what link to click so not click the same link 2 times at same day.

techboy992

12:13 pm on Feb 15, 2011 (gmt 0)

10+ Year Member



that will also prevent that the user click the link alot of times, so she get payed more than she shall for click that is not a value for us, bec the topsites to our home page will only accept 1 click a day, so if she click the link more than one time the user will get payed to much in order to usefull clicks.

londrum

12:35 pm on Feb 15, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



if payment is involved then cookies are actually a bad idea, so forget that. because some users might not accept the cookie, or they might have javascript disabled.

i would send the click through a redirect URL and log the click in a database. you can then record things like the users IP address and user_agent.

that way, you can carry on showing the link all the time, and work out which clicks should be paid through the database.

techboy992

5:11 pm on Feb 15, 2011 (gmt 0)

10+ Year Member



It will be alot of work to read that log file alwayes