Problems when someone posts a message with a " sign

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
hobe
Forum Newbie
Posts: 2
Joined: Thu Jun 27, 2002 11:55 am

Problems when someone posts a message with a " sign

Post by hobe »

When someone posts a message in my guestbook containing a " sign it will allways show like this: \" how can I avoid that ???
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

The quotes have to be escaped otherwise you'll have problems. What you need to do is, before the info is output to the browser use the stripslashes() function:

Code: Select all

$message = stripslashes($message);
echo $message;
That'll get rid of all those backslashes.

Mac
hobe
Forum Newbie
Posts: 2
Joined: Thu Jun 27, 2002 11:55 am

Thanks !

Post by hobe »

It worked as I wanted, I'm glad for your help /// hobe
Post Reply