nicobach1 Posted December 28, 2009 Share Posted December 28, 2009 Hello everyone, im a newb at php and really could use some help. Im trying to figure out how i can disable a hyperlink after it has been clicked an 'X' amount of time. this is really important and urgent, any help would greatly be appreciated!! Quote Link to comment https://forums.phpfreaks.com/topic/186522-disable-hyperlink-after-x-amount-of-clicks/ Share on other sites More sharing options...
sKunKbad Posted December 28, 2009 Share Posted December 28, 2009 Does the link take you to another page, or is it a pop-up or Ajax type of request? Quote Link to comment https://forums.phpfreaks.com/topic/186522-disable-hyperlink-after-x-amount-of-clicks/#findComment-985046 Share on other sites More sharing options...
nicobach1 Posted December 28, 2009 Author Share Posted December 28, 2009 it will be a print function link, where the print dialogue box pops up. i only want an 'X' amount of people to be able to print something. Quote Link to comment https://forums.phpfreaks.com/topic/186522-disable-hyperlink-after-x-amount-of-clicks/#findComment-985047 Share on other sites More sharing options...
Buddski Posted December 28, 2009 Share Posted December 28, 2009 If its for ALL people say the first 10 visitors. You would need ajax to do it for you.. You will also need a database to record the amount of times that the link was clicked.. Quote Link to comment https://forums.phpfreaks.com/topic/186522-disable-hyperlink-after-x-amount-of-clicks/#findComment-985055 Share on other sites More sharing options...
nicobach1 Posted December 28, 2009 Author Share Posted December 28, 2009 Buddski, it is for ALL people, now i dont know ajax, could you point me in the right direction where i might be able to find the code that im looking for? Quote Link to comment https://forums.phpfreaks.com/topic/186522-disable-hyperlink-after-x-amount-of-clicks/#findComment-985061 Share on other sites More sharing options...
Buddski Posted December 28, 2009 Share Posted December 28, 2009 http://www.tizag.com/ajaxTutorial/ Basically, this is how its gotta work.. When your page is being displayed you need to check the count in the database.. if the count is less than the limit allow the link.. if not disable the button.. If the button is active and they click it you need to send an ajax request to update the clicked status and then run the rest of your code. Quote Link to comment https://forums.phpfreaks.com/topic/186522-disable-hyperlink-after-x-amount-of-clicks/#findComment-985065 Share on other sites More sharing options...
nicobach1 Posted December 28, 2009 Author Share Posted December 28, 2009 i understand how it all needs to work, my problem is that i have very little knowledge when it comes to php/ajax/javascript, im still in the process of learning all of this. I was hoping that someone might know of a site that has the code im looking for pre-written for a free download/copy or someone that would be kind enough to provide the code for me. i have been looking all day for some sort of code that would do what im looking for but have found nothing and now im stuck. i need to have the website up and running in two weeks! :-\ Quote Link to comment https://forums.phpfreaks.com/topic/186522-disable-hyperlink-after-x-amount-of-clicks/#findComment-985077 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.