I'm creating a web page that will allow users to paste in their code and be given a unique URL to access it later. The problem is that I am using
mysql_real_escape_string($_POST['code'])
to prevent sql injection but at the same it adds slashes to the code which means when the code is displayed at a later date, it is spoiled (slashes everywhere.)
Is there a way to 'un-escape' it when displaying the code again?
Sorry if this seems unclear or obvious, this is my first project using php.
mysql_*functions as they are now deprecated. Use MySQLi or PDO instead.mysql_real_escape_string()or are they in$_POST?stripslashes()is an answer to is "how do I fix my goofed up data?". PHP should be configured properly in the first place to not cause this.