Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-11-2007, 01:09 PM   #1
Zeno McDohl
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 317

Rep: Reputation: 30
Why is addslashes adding a quote?

According to this is the expected output:
$str = "Is your name O'reilly?";

// Outputs: Is your name O\'reilly?
echo addslashes($str);
Instead, I get this on my server:
Is your name O''reilly?
Why am I getting two quotes, instead of it being escaped?

The server PHP version is 4.4.4 and MySQL 4.1.22-standard.
Old 06-11-2007, 03:46 PM   #2
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 31
Check your php.ini file. From the addslashes manual page:
Having the PHP directive magic_quotes_sybase set to on will mean ' is instead escaped with another '.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Price quote... jsm Linux - General 2 11-08-2006 02:20 PM
Boot Quote? liquidrabbit Slackware 3 04-10-2006 05:37 PM
simple: php addslashes, magic quotes, etc etc? opioid Programming 6 03-01-2005 01:43 PM
Quote Server oulevon Programming 2 12-04-2002 09:59 AM
quote tundra General 2 09-21-2002 05:58 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration