LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


According to http://us.php.net/addslashes this is the expected output:
Code:
<?php
$str = "Is your name O'reilly?";

// Outputs: Is your name O\'reilly?
echo addslashes($str);
?>
Instead, I get this on my server:
Quote:
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
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

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


Reply


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


All times are GMT -5. The time now is 10:14 AM.

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