Jump to content

code generates back slashes


ROCKINDANO

Recommended Posts

i have a php form where users can update db. but when the input has a <a href=""></a> input, it generates back slashes on the web.

 

below is the results after the input.

<a href=\'\\\"images/gallery/storyslideshow/ppic-5 (1).jpg\'\\\" rel=\'\\\"lyteshow[featgallery]\'\\\" title=\'\\\"\'\\\">View Slideshow</a><br><br>

 

i have a this on my updating code

mysql_real_escape_string($_POST["fulldesc"]);

Link to comment
https://forums.phpfreaks.com/topic/232174-code-generates-back-slashes/
Share on other sites

You don't want to arbitrarily apply stripslashes to data being pulled from a database. If slashes are coming out of the database, the problem usually likely exists before the point at which the data is being inserted. You should make sure magic_quotes_gpc is Off in your php.ini file, if you're able to do so. If you want to write code that's portable, when escaping data for insertion, first check for magic_quotes_gpc, and if it's On, apply stripslashes before escaping the data. If it's not On, escape the data normally without using stripslashes on it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.