help with javascript and magic quotes

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
planethax
Forum Newbie
Posts: 21
Joined: Thu Sep 11, 2003 9:34 am

help with javascript and magic quotes

Post by planethax »

at this point I can not get my host to turn off "magic_quotes_runtime" or "magic_quotes_sybase" for some reason.

now I have a site that with every javascript call it adds and extra ' which I am told is due to the magic quotes.

I found a post saying you could turn them off with .htaccess but when I tried I get a 500 server error.

Is there anything else I can do? how to rewrite the following code?

Code: Select all

<td><a href="Javascript&#058;bookmark('{siteName}', '{siteURL}')" class="footerColorSet1">Bookmark us </a></td>
that ends up adding an extra ' like this
javascript:bookmark(''PHPizabi'', ''http://www.mysite.com/directory'')
and causes an error
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Re: help with javascript and magic quotes

Post by Skara »

You misunderstand magic quotes. Magic quotes does nothing more than escape your characters for you.
In other words, it turns this:
'
into this:
\'
Post Reply