开发者

Whats the quickest and most secure way to write form data to a MYSQL database

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.

  1. Validate the user input on the client side (not really needed, but nice for the user)
  2. Validate the user input on the server side
  3. Sanitize the user's input using for example mysql_real_escape_string http://php.net/manual/en/function.mysql-real-escape-string.php
  4. insert data in mysql
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜