Page 1 of 1

help with javascript and magic quotes

Posted: Mon Jul 13, 2009 7:41 pm
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

Re: help with javascript and magic quotes

Posted: Mon Jul 13, 2009 8:49 pm
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:
\'