Log in

View Full Version : Post Slashes



Jas
07-11-2008, 10:17 PM
When I post from a form to PHP, on one server the post:

\
\\
\\\
\\\\
Looks just like that when I echo it out in PHP, but on another server, when I echo it out, it looks like this:

\\
\\\\
\\\\\\
\\\\\\\\

What is causing the difference, and how do I fix it? Both servers use PHP 5, but both are different OS (one is win Vista, the other-- which adds the slashes-- is Linux).

thetestingsite
07-11-2008, 10:26 PM
it could be magic_quotes_gpc (http://us2.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc) is enabled on the one server and not the other. That's one thing that I could think of off the top of my head.

Jas
07-11-2008, 10:54 PM
Can that be turned off at runtime?

techietim
07-11-2008, 11:01 PM
Put the following in your .htaccess file


php_flag magic_quotes_gpc Off

thetestingsite
07-11-2008, 11:01 PM
you can disable it in the php.ini file, if that's what you mean.

sorry techietim, cross post.

Jas
07-11-2008, 11:03 PM
Well, I can't get at the php.ini file, and the .htaccess causes errors. I don't know why, but I suspect the server doesn't like changes to server settings. :( any other options?

thetestingsite
07-11-2008, 11:05 PM
any other options?


Talk to your host or use ini_set (http://php.net/ini_set) in your php script.

Jas
07-11-2008, 11:07 PM
Thanks a million, guys. I created a if/else statement to get around it. Hopefully that will solve it all.