I'm testing my programming skills, and came to a question. How can I prevent bad people to use a form to submit data to my site. For example I have a form where the user can change their password. Now if somebody copy the same code and uploads it to their site, but point it to my processor file, it will change the data in my tables.
I'm aware of the "Captcha", but it is a pain in the...
The second method I thought of is creating a random hash from random things and then putting it into the form and into _SESSION, and then on the next page I verify that $_POST['hash'] == $_SESSION['hash']
, but can they submit data in _SESSION too?
Like setting the form input 'hash' = "hash"
, and setting $_SESSION['hash'] = "hash"
.
So the question is given. Thank you if you help me.