[web] [SOLVED] PHP - Disabling magic_quotes_gpc not seeming to work

This topic is 4258 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

quote]

You mean $_GET? Since I'm really not sure what you are doing (an example would be best) have you tried just using the stripslashes / addslashes functions? Share this post Link to post Share on other sites I'm using Xampp on Windows, and I'm fairly certain that the php.ini file used is in xampp\php\php.ini (running PHP 5). markadrake >> Well, technically$_GET, $_POST, and$_COOKIE.
I'm just using simple forms:
Form:<form action='file.php' method='post'><input name='title' value='Title'><br><textarea name='desc'>Stuff goes here<br></form>file.php:if ($_POST["title"]) {$title=...; //register_globals is disabled}

For now, I'm using those two functions, but I guess it would be better for me if I didn't have to worry about stripslashes when retrieving something via post. Since I can't do it on my local server, I'll have to make sure it's still On on the server I'm working with.

Ah, forgot to metion, the flag is "magic_quotes_gpc"... Not sure what it is on PHP 4.x.

Share on other sites
Aw, crap. Stupid, stupid, stupid me.
I forgot that phpinfo() listed where the config file was, and I was too ign'ant to look there.
Ends up it was in the bin directory of apache.
Thanks for the help.

[Edited by - deadimp on April 22, 2007 5:12:22 PM]

Share on other sites
See? I told you it was under a sub folder of apache! I had to make this exact change on Thursday in the same scenario [smile]

Share on other sites
Today's cliche: Ignorance is bliss, when it doesn't bite you in the arse.

Share on other sites
magic_quotes_gpc might well be enabled on your production server - and you might not be able to disable it via the ini file!

My preferred fix is to leave it on in the server configuration, but to add a .htaccess file to the site root containing the line:

php_flag magic_quotes_gpc off

1. 1
2. 2
Rutin
19
3. 3
khawk
19
4. 4
5. 5
A4L
11

• 9
• 12
• 16
• 26
• 10
• Forum Statistics

• Total Topics
633771
• Total Posts
3013763
×