Shoutbox

new host inserting "\"'s everywhere - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: new host inserting "\"'s everywhere (/showthread.php?tid=62837)

new host inserting "\"'s everywhere by stoshrocket on 07-08-2006 at 07:13 PM

ive just paid for some new hosting and a domain with invisional hosting and all of a sudden there are aload of "\"s everywhere... meaning alot of the code is messed up....

link

as you can see, there's a randomly instered \ before every inverted comma (') in the text visible and in some of the includes before every speech mark (") as well... anyone know what's causing this??


RE: new host inserting "\"'s everywhere by Ezra on 07-08-2006 at 08:11 PM

I think it's "magic_quotes_gpc".

I'm not sure how to disable it, try stripslashes or something in that fashion.

EDIT:
http://php.net/manual/en/ref.info.php#ini.magic-quotes-gpc


RE: new host inserting "\"'s everywhere by Mike on 07-08-2006 at 09:08 PM

I think that this is done to prevent sql injections..
It's for your own good ;)

But the problem is, that I don't know how to prevent sql injections, while not having the "\"... :(


RE: new host inserting "\"'s everywhere by hmaster on 07-08-2006 at 09:10 PM

str_replace() before they're outputted, thats what I do.
If you use a CMS type thing, when writing it to a file/db replace them then.


RE: new host inserting "\"'s everywhere by absorbation on 07-08-2006 at 09:12 PM

quote:
Originally posted by Mike

But the problem is, that I don't know how to prevent sql injections, while not having the "\"

addslahes you mean, well you could try mysql excape string, which it slighly more sercure. But it is good your host is doing this, sql injection is a major sercuity hole hackers will look at :P.
RE: new host inserting "\"'s everywhere by Ezra on 07-08-2006 at 09:55 PM

Just use stripslashes on all the sql outputted strings to remove the slashes


RE: new host inserting "\"'s everywhere by stoshrocket on 07-09-2006 at 04:39 PM

ok, awesome, thanks for the help