It a place where there are many different pages on many different sites all giving different points of view as to the correct way to input data to MYSQL. Some swear by using spritf, mysql_real_escape_string,filter_var or even filter_input in different formats.
Scenario:
Data from a form (be it GET or POST), lets say the data from the form is POST $_POST("record") and the data is
Fred's record keeping is great
Now in the page that processes the data is the confusing bit.
Should the correct way using the above data just be.
Validate $POST("record") is set using isset
Preform mysql_real_escape_string on $POST("record")
place in MYSQL using INSERT SQL
or
Validate $POST("record") is set using isset
Preform mysql_real_escape_string on $POST("record")
Sanitize $_POST("record") using filter_var with FILTER_SANITIZE_STRING
place in MYSQL using INSERT SQL
or another way. So what is the correct way to make sure that the apostrophes are OK and no nasty HTML code is dumped.
Thanks for helping this confused Man. I just want to make sure the data is secure from attacks.
Also if the data being submitted as HTML with HTML tags what needs to be changed in the procedure to take care of the HTML.