Hi,
When a user submits something into my code it is then submitted into a MySQL database... before the data passes through my coding I stick strip_tags() around the $_POST['']. Should I be also sticking htmlspecialchars() the $_POST['']s ?
Also, when a user puts carriage returns in say... a comment I'd like it to submit to the database WITH those carriage returns. How can I do that please?
One last thing, as you all know ' are used a lot in SQL injection so they need to be removed which is what strip_tags() does. Anyway, when a user does submit e.g. the word "that's" it gives an error due to the '. How can I safely allow users to submit ' when they're used properly?
Thanks,
Craig.
When a user submits something into my code it is then submitted into a MySQL database... before the data passes through my coding I stick strip_tags() around the $_POST['']. Should I be also sticking htmlspecialchars() the $_POST['']s ?
Also, when a user puts carriage returns in say... a comment I'd like it to submit to the database WITH those carriage returns. How can I do that please?
One last thing, as you all know ' are used a lot in SQL injection so they need to be removed which is what strip_tags() does. Anyway, when a user does submit e.g. the word "that's" it gives an error due to the '. How can I safely allow users to submit ' when they're used properly?
Thanks,
Craig.