473,796 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disable magic_quotes_gp c in a .htaccess file

Hi All,

How do I disable magic quotes via .htaccess?

I put the following file in my webroot, but it does not disable
magic_quotes_gp c (according to phpinfo(), both the local and master value
are still "on")

<IfModule mod_php4.c>
php_value upload_max_file size 8M
php_value magic_quotes_gp c 0
</IfModule>
The change to upload_max_file size works (master is 2M, local value is 8M,
according to phpinfo())

Guess I've got something wrong. Any help?

-Josh
Jul 17 '05 #1
8 50626
Joshua Beall wrote:
Hi All,

How do I disable magic quotes via .htaccess?

I put the following file in my webroot, but it does not disable
magic_quotes_gp c (according to phpinfo(), both the local and master value
are still "on")

<IfModule mod_php4.c>
php_value upload_max_file size 8M
php_value magic_quotes_gp c 0
</IfModule>
The change to upload_max_file size works (master is 2M, local value is 8M,
according to phpinfo())

Guess I've got something wrong. Any help?

-Josh


Close but no cigar - try:

php_value magic_quotes_gp c off

Cheers,

James
--
Fortune cookies says:
To find out a girl's faults, praise her to her girl friends.
-- Benjamin Franklin

Jul 17 '05 #2
Joshua Beall wrote:
How do I disable magic quotes via .htaccess?


Unfortunately you can't change it in the .htaccess file. By the time
the .htaccess file is parsed magic quotes have already been added if the
setting is on. The only way to change the setting and have it work is to
change the Apache httpd.conf file, assuming you are able to.

Chris

--
Chris Hope
The Electric Toolbox Ltd
http://www.electrictoolbox.com/
Jul 17 '05 #3

"Chris Hope" <bl*******@elec trictoolbox.com > wrote in message
news:dX******** *********@news. xtra.co.nz...
Joshua Beall wrote:
How do I disable magic quotes via .htaccess?


Unfortunately you can't change it in the .htaccess file. By the time
the .htaccess file is parsed magic quotes have already been added if the
setting is on.


Really? Hmm. In the documentation it lists that setting as
"PHP_INI_PERDIR ", meaning it can be changed on a per directory basis with
..htaccess files.

This is not true?
Jul 17 '05 #4
"Centurion" <sp*******@nowh ere.com> wrote in message
news:ta******** ****@news.grayo nline.id.au...
Close but no cigar - try:

php_value magic_quotes_gp c off


Bingo, that did it. Strange thing is, I thought for *sure* that is one of
the things I tried.

Anyway, thanks!
Jul 17 '05 #5
Joshua Beall wrote:

"Chris Hope" <bl*******@elec trictoolbox.com > wrote in message
news:dX******** *********@news. xtra.co.nz...
Joshua Beall wrote:
> How do I disable magic quotes via .htaccess?


Unfortunately you can't change it in the .htaccess file. By the time
the .htaccess file is parsed magic quotes have already been added if the
setting is on.


Really? Hmm. In the documentation it lists that setting as
"PHP_INI_PERDIR ", meaning it can be changed on a per directory basis with
.htaccess files.

This is not true?


Actually yes you're probably correct. I was thinking of ini_set() (doh!)
where it obviously won't work. Funny thing is I just tried this now where
the default is off and tried to force it on with a .htaccess file on my
local machine and phpinfo() showed the value unchanged. Oh well, from your
response to another post looks like you got it sorted out :)

Chris

--
Chris Hope
The Electric Toolbox Ltd
http://www.electrictoolbox.com/
Jul 17 '05 #6
> Chris Hope
The Electric Toolbox Ltd
http://www.electrictoolbox.com/


I took a look at your site. Some good articles.

Question: what did you do your site with? Is it a CMS of your own making?
Just curious.
Jul 17 '05 #7
Joshua Beall wrote:
I took a look at your site. Some good articles.

Question: what did you do your site with? Is it a CMS of your own making?
Just curious.


Yes, a CMS of my own making. I've been meaning to write about it in the
about the site section but found much more interesting things to write
about. I usually write stuff down so I don't forget it and by putting it
online it makes it easier to find again.

The CMS uses PHP and MySQL. The data is read out of MySQL using the PEAR
database objects and everything is stored into XML. That is then parsed
into HTML using an XSL stylesheet. I just need to get around to making it
all XHTML compliant now... (it's pretty close to being so).

Chris

--
Chris Hope
The Electric Toolbox Ltd
http://www.electrictoolbox.com/
Jul 17 '05 #8
jn
"Joshua Beall" <jb****@donotsp am.remove.me.he raldic.us> wrote in message
news:P%******** *********@nwrdd c03.gnilink.net ...
Hi All,

How do I disable magic quotes via .htaccess?

I put the following file in my webroot, but it does not disable
magic_quotes_gp c (according to phpinfo(), both the local and master value
are still "on")

<IfModule mod_php4.c>
php_value upload_max_file size 8M
php_value magic_quotes_gp c 0
</IfModule>

Try

php_flag magic_quotes_gp c off
Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1425
by: lkrubner | last post by:
Hi. I want all my html files sent to the php parser for parsing. I tried to put up an .htaccess file with just this in it: AddType application/x-php .htm Action application/x-php /usr/bin/php AddType application/x-php .html Action application/x-php /usr/bin/php
4
2813
by: Stefan Bellon | last post by:
Hi all! I want to parse the contents of an .htaccess file from within PHP. The contents of the .htaccess file looks like this: <Files foobar.tar.gz> AuthType Basic AuthUserFile /foobar AuthName "Foobar" <Limit GET>
1
2375
by: asllearner | last post by:
I have an htaccess file protected folder. In that folder I have several php files that generate some simple html. When I am logged out, cache cleared, sessions info cleared, I navigate to one of the php scripts, and the login screen shows up. so far so good. But now, even if i enter invalid information in the login screen, or cancel out of it, my php script seems to be running, and my information is showing up in the browser. what:s up...
2
1512
by: jyotsna.purkar | last post by:
Can we write php script in .htaccess file? please explain with suitable example.
2
5577
by: slow2fear | last post by:
Hi, My current .htaccess file contains this: # -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST> order deny,allow deny from all allow from all
0
2138
by: deco12 | last post by:
Hi, I am new to web design and Apache, but have managed to password protect my site by putting a .htaccess file in the sites root directory. I have set it up so that a number of members have access to the site. Now, within the site I have a link to a "document" folder which I only want 2 or 3 members to have access to. I have created a second .htaccess & .ht passwd file, with the path to the new folder and a different password. This was...
5
2010
by: mukeshrasm | last post by:
Hello I want to create .htaccess file in PHP and for website why do we require to have this file. means what are the advantage if I create.
4
6128
by: kkshansid | last post by:
to run captcha i uncommented extension=php_gd2.dll in php.ini page but on server i want to make this change by .htaccess file so i made a file with .htaccess extension and pasted on it extension=php_gd2.dll uploaded it on server but this method doesnt work kindly help me to make this uncomment change on .htaccess file
2
1837
pradeepjain
by: pradeepjain | last post by:
Since we are hosting websites on different hosting sites, we wont have the access to php.ini file . so where do i need to add the entries like php_value upload_max_filesize 20M php_value post_max_size 20M php_value max_execution_time 200 php_value max_input_time 200 in the .htaccess file.
0
9530
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10236
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.