Why Does Output From Php Have \'s In It?, I see \'s in SQL and HTMP output from PHP how do I remove it? |
Why Does Output From Php Have \'s In It?, I see \'s in SQL and HTMP output from PHP how do I remove it? |
Jun 14 2006, 06:34 PM
Post
#1
|
|
WSF Commander Group: Admin Posts: 4,662 Joined: 26-August 05 Member No.: 10 |
SYMPTOMS
I see \'s in SQL and HTMP output from PHP and it causes the SQL to error and the HTML to display incorrectly. CAUSE Your host has turned on "magic quotes". This is a feature of little value and only causes confusion. Consequently most hosting companies do not switch this feature on. SOLUTION There are three solutions: 1. Turn it off by adding the following to your .htaccess file: CODE php_flag magic_quotes_gpc off 2. Ask your host to switch it off in the PHP.ini file. 3. If your host blocks the use of .htaccess files (very few do) and will not change the PHP.ini so that magic quotes are NOT used then the only option is to switch hosting companies. |
|
|
Jul 26 2007, 06:38 PM
Post
#2
|
|
WSF Superstar Group: PM Unlimited Posts: 401 Joined: 2-November 06 Member No.: 737 |
I am having the\\\\ issue in my emails.
Should magic quotes be on or off in the BCP? -------------------- |
|
|
Jul 26 2007, 08:23 PM
Post
#3
|
|
WSF Junkie Group: Members Posts: 104 Joined: 2-May 07 From: Australia Member No.: 1,087 |
I am having the\\\\ issue in my emails. Should magic quotes be on or off in the BCP? Hi Ken, once you fix up the database and if you server won't turn off the magic quotes(chances they won't) I have found a few small work arrounds to overcome the \\\\\ problem. 1. use ` instead of ' (that's the one just left of the number one key) works a treat. 2. remove all ' and " from any html you write (very easy just use the replace function in your html editor) what I do is replace the" just with a space and bingo it all works fine. Hope this helps Rich -------------------- |
|
|
Jul 26 2007, 08:34 PM
Post
#4
|
|
WSF Superstar Group: PM Unlimited Posts: 401 Joined: 2-November 06 Member No.: 737 |
Hi Ken, once you fix up the database and if you server won't turn off the magic quotes(chances they won't) I have found a few small work arrounds to overcome the \\\\\ problem. 1. use ` instead of ' (that's the one just left of the number one key) works a treat. 2. remove all ' and " from any html you write (very easy just use the replace function in your html editor) what I do is replace the" just with a space and bingo it all works fine. Hope this helps Rich Hey Rich, I'll give it a go. I tried changing the magic quote setting in BCP, that didn't do anything. It's amazing how many times we use that little guy, isn't it? LOL Thanks!! -------------------- |
|
|
Lo-Fi Version | Time is now: 19th April 2024 - 11:04 AM |