/'s appearing on displaying info stored on mySQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CdnRebel
Forum Newbie
Posts: 4
Joined: Wed Jan 03, 2007 9:35 am

/'s appearing on displaying info stored on mySQL

Post by CdnRebel »

Hi,

When a field is entered with a quote and stored on mySQL and redisplayed, a "/" is added and if I keep on redisplaying, more "/" get added. The text info is being stored on the file and the file information is displaying, so what would be happening in the syntax to cause that?

Thanks,
CdnRebel
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Basically, you have magic quotes enabled, you should disable this in your php.ini or .htaccess file. You can also strip the slashes during your script's execution.

Code: Select all

if (get_magic_quotes_gpc()) {
   $_POST = array_map('stripslashes', $_POST);
}
CdnRebel
Forum Newbie
Posts: 4
Joined: Wed Jan 03, 2007 9:35 am

slashes appearing when text with quotes is redisplayed

Post by CdnRebel »

Thanks JCart,

I'll try other methods before posting again.

CdnRebel
Post Reply