Secure ajax form POST

Posted by user194630 on Stack Overflow See other posts from Stack Overflow or by user194630
Published on 2010-05-22T17:07:33Z Indexed on 2010/05/22 17:10 UTC
Read the original article Hit count: 483

Filed under:
|
|
|
|

I was wondering how to develop a secure form post through AJAX.

For example, i have:

My HTML form.

My JavaScript handling the submit.

The submit url is "post_data.php"

The posted data is:

id=8&name=Denis

The PHP verifies if variables id and name are POSTED and their data type. If this is ok it proceed to do some stuff on a database.

My question is, how can i prevent someone from creating his own html form, outside my web site, or whatever, and posting false data to my PHP script?

Imagine that data realy exists on my database, this could be bad.

Thanks

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about security