The script will act this way, a user will come to the page, clicks on a button, it will show certain text, then the page will be blocked for 24hours for that user and will say "you can do it again after 24 hours". the user will be able to access the page after 24 hours passes. Please help me out with it. Not asking for complete thing, asking help for guidance. Thank you very much.
Do the users have a username? if so just put the username along with the time they saw the text into a database, you can either format it according to db timestamp format or just use the output from php's time() function and store that as BIGINT or such, then you can just check the db to see the amount of time passed, and act accordingly. then you can update the db again when they click button again, and if not using a username or such you will need to do the above using either cookies or ip address in place of username.
Log the username + time, then whenever the button is clicked check if the time (last logged), is after 24 hours...proceed else...error.
Just catch the IP, Username and Hour i.e time and store them and compute an function such that it can allow to login in a difference of prescribed hours!