Storing cookies for future form submissions
Yosef Naser’s Question:
Is there any way to store data submitted in cookies and when the same form is loaded again the text fields are filled with the stored values in cookies ?
I have a shopping website and i don’t wanna require customers to register, so when they order an item and come back again to order another item the form is prefilled with their information.
I’ve looked around but no one seems to mention such thing.
You can use $_COOKIE[]
to access and retrieve information stored in cookie.
Limit posting to every 30 minutes
Question by jay
Thanks for looking.
I’m trying to write a script to set a cookie after the user posts a comment, limiting them from posting again for 30 minutes. I’m so confused on where to start. Please, could you guys help me out on how I do this?
I’m trying to use this jquery plugin – countdown timer.
Answer by Starx
Use Session
For example, after a post, put the current time + 30 minutes in your session line this
$_SESSION['postTimeFlag'] = time() + 1800;
Then whenever the user is about to post then the session