I am looking to store data from a form in a mysql database 开发者_StackOverflowand being new to this I would like to do this in a fairly easy way using PHP but I don't want the form hacked by everyone the first day its out there :-)
This is not credit card info, in fact if anyone read it, it would not matter at all but I still would like to stop bad data and people adding form entries if that were possible.
I imagine most online apps have a basic level of security and being new I am worried I fail to put that in place.
There are some basic rules you have to apply.
- Validate the user input on the client side (not really needed, but nice for the user)
- Validate the user input on the server side
- Sanitize the user's input using for example
mysql_real_escape_string
http://php.net/manual/en/function.mysql-real-escape-string.php - insert data in mysql
精彩评论