lbphond  Remy lbphond Remy - 1 year ago 71
PHP Question

PHP generates new rand() after submitting

I've got a problem that (I think) more people got.
I generate a rand() in my PHP script, and if the form that I created submits, I don't want to create a new rand(), what's he actually doing right now.

I DON'T want to...

  • Set the value in a SESSION or COOKIE

  • Set the data in a hidden input

Because of..
Security reasons (it's a simple captcha)


Answer Source

There is no other way than saving it in a session. It is very secure and easy to obtain. You can even unset the session after you're done verifying it!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download