Forum Moderators: coopster

Message Too Old, No Replies

PHP script putting Slashes in front of Apostrophes

         

starseed

5:00 pm on Feb 22, 2005 (gmt 0)

10+ Year Member



I just put up a script where people can make their own quizzes, but when a user inputs a word with an apostrophe, it displays on the page with a slash in front of it. For example:

Eric/'s Quiz

Is there anyway to fix that?

The script is called phpQuest 0.15 from a site that's no longer around, and I couldn't find any help about this issue on the Archived version of the website.

Thanx for any help

horaghn

5:02 pm on Feb 22, 2005 (gmt 0)

10+ Year Member



You need to add the following to the echo statement on the variable that is returning the item.

stripslashes( $cVar );

coopster

11:02 am on Feb 23, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, starseed.
Welcome to WebmasterWorld, horaghn.

You're running into PHP's magic quotes. A quick search of this forum will turn up plenty of discussion.

Help with magic quotes [webmasterworld.com]