473,398 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

magic_quotes_gpc ?

Hi All,

are there any ideas of how to keep the magic_quotes_gpc variable in ini
file - "On" or "Off". I just noticed the difference between local settings
and server's ones. So i cant decide what to fix.

Thanks.


--
Exact Meta Search | Major Search Engine
http://exactsearcher.com
Nov 5 '05 #1
4 1619
Berimor wrote:
are there any ideas of how to keep the magic_quotes_gpc variable in ini
file - "On" or "Off". I just noticed the difference between local settings
and server's ones. So i cant decide what to fix.


I say off. But whichever you decide on, check for the status in your
scripts for them to be more portable.

--
E. Dronkert
Nov 5 '05 #2
On Sat, 05 Nov 2005 22:21:32 +0100, Ewoud Dronkert
<fi*******@lastname.net.invalid> wrote:
Berimor wrote:
are there any ideas of how to keep the magic_quotes_gpc variable in ini
file - "On" or "Off". I just noticed the difference between local
settings
and server's ones. So i cant decide what to fix.


I say off. But whichever you decide on, check for the status in your
scripts for them to be more portable.


Thanx.

The matter is i was developing the site using my local setting - "Off" -
and it's the first hosting i met that has this setting "On":( Also i just
read this http://lists.evolt.org/archive/Week-...19/161762.html
- so think i'll try to keep it "Off" everywhere.


--
Exact Meta Search | Major Search Engine
http://exactsearcher.com
Nov 5 '05 #3
If you use On, PHP will automatically escape single and double quotes,
backslashes and null characters, you'll have to use stripslashes() if
you want the original string. This reduces efficiency because, you
don't always need to escape every single string, but in the other hand,
protects you a bit more from SQL injection.

http://www.php.net/manual/en/function.addslashes.php
http://www.php.net/manual/en/function.stripslashes.php
http://www.php.net/manual/en/ref.inf...gic-quotes-gpc

Nov 5 '05 #4
Cameri said the following on 05/11/2005 21:57:
If you use On, PHP will automatically escape single and double quotes,
backslashes and null characters, you'll have to use stripslashes() if
you want the original string. This reduces efficiency because, you
don't always need to escape every single string, but in the other hand,
protects you a bit more from SQL injection.


Except, of course, that if you want your script to be portable, then
you'll have to manually test for magic_quotes_gpc setting, and if it's
"Off", then you'll have to manually escape anyway.

And, of course, the fact that it doesn't really help that much against
SQL injection, because escape syntax varies between SQL variants. The
results of magic_quotes aren't strictly correct for MySQL, and not at
all correct for MS SQL Server nor PostgreSQL.
--
Oli
Nov 5 '05 #5

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

Similar topics

3
by: williamc | last post by:
My first impulse was to turn it off. But maybe I'm wrong. Or is it one of those 6 of one half a dozen of the other things? From what I'm seeing on a search it might improve performance slightly...
8
by: Joshua Beall | last post by:
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_gpc (according to phpinfo(), both the local and master value...
0
by: Al | last post by:
Hi I mode a site from to a new server where trere is: PHP Version 4.3.2 and magic_quotes_gpc On On magic_quotes_runtime Off Off magic_quotes_sybase Off Off
5
by: Jean-Marc Molina | last post by:
Hello, OS : Windows 2000 Pro Apache : 1.3.29 PHP : 4.3.6 From the install.txt file : quote: "Usually you would just copy it over to %SYSTEMROOT%\System32.
4
by: Jan Pieter Kunst | last post by:
Q. How do I use addslashes() and stripslashes() when dealing with HTML forms and database INSERTs, UPDATEs and SELECTs? A. It depends on the setting of the php.ini directive "magic_quotes_gpc"....
5
by: lawrence k | last post by:
This seems so simple, I can't believe its tripping me up. I've a database class with a query method that looks like this: function query($query=false) { global $controller; // $query =...
2
by: hermanh128 | last post by:
I have a webserver hosting several websites running several php programs. Some but not all programs check magic_quotes_gpc is ON before using the addslashes function. Currently, magic_quotes_gpc is...
2
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
6
by: redog6 | last post by:
Hi I have a webform with many free text fields and have a problem with apostrophes and single quotes as this breaks the mysql query string. I obviously need to escape these characters -...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...

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.