Jump to content

Disable a button for x amount of time after its been clicked?


crf121359

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.