crf121359 Posted April 3, 2012 Share Posted April 3, 2012 Hi, I am new to PHP world!! I am just trying to find a way to disable a button after its been clicked for lets say 5 minutes. I have searched google and haven't found what I am looking for. I just dont want the users to be able to refresh the page and the button becomes enabled again. any code examples with explanation or a simple tutorial will be much appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
crf121359 Posted April 3, 2012 Author Share Posted April 3, 2012 anyone?! Quote Link to comment Share on other sites More sharing options...
trq Posted April 3, 2012 Share Posted April 3, 2012 When the button is clicked you will need to store a timstamp in a database. Before displaying it again, you will need to check this timestamp to see if it is set within the timeframe you want. If it's not, you can display the button. Quote Link to comment Share on other sites More sharing options...
crf121359 Posted April 3, 2012 Author Share Posted April 3, 2012 As much as I appreciate your reply but I didn't understand how its done to be honest. any chance you could show me an example code? something simple for my newbie brain? cheers Quote Link to comment Share on other sites More sharing options...
trq Posted April 3, 2012 Share Posted April 3, 2012 As I'm sure you can tell from the description, it's not exactly a simple problem and would require more code than I am prepared to provide. Iv'e described the solution pretty well, all you need do is put it together. Do you know how to insert data into and read data from a database? If not, I would start there. Quote Link to comment Share on other sites More sharing options...
crf121359 Posted April 3, 2012 Author Share Posted April 3, 2012 Yes, I know how to enter data and read data from a database. I just don't understand what timstamp is and how to store it and then read it etc!? Quote Link to comment Share on other sites More sharing options...
Jessica Posted April 3, 2012 Share Posted April 3, 2012 A timestamp is an integer that represents time. If you know how to store and read data from a database, you know how to do that same exact thing with a timestamp. Quote Link to comment 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.