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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.