473,686 Members | 2,783 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 50619
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
1422
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
2808
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
2368
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
1507
by: jyotsna.purkar | last post by:
Can we write php script in .htaccess file? please explain with suitable example.
2
5573
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
2130
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
2004
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
6119
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
1828
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
8584
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8932
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
8768
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
7599
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
6440
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
4308
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2945
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2205
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.