Gossamer Forum
Home : General : Internet Technologies :

Magic Quotes...

Quote Reply
Magic Quotes...
Does anyone know how to disable these in a script? I know its possible by editing php.ini, but i most people don't have access to that :( I've tried doing some ereg_matche's, but they dson't seem to affect it :(

$new = ereg_replace('\"', '"', $line);
$new = ereg_replace("\'", "'", $line);

If anyone has any thoughts on this, I'm all ears...this has been bugging me for ages Frown

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy.] Magic Quotes... In reply to
Sorry, what are you trying to do? Get rid of "quotation marks" from a string?

- wil
Quote Reply
Re: [Andy.] Magic Quotes... In reply to
I've done this before - its something like:

magic_quotes(0);

or:

magic_quotes_gpc(0);

can't remember exactly.
Quote Reply
Re: [Andy.] Magic Quotes... In reply to
Hi,

Is this in PHP?

Will this function stripslashes?

$line = stripslashes($line);

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [Andy.] Magic Quotes... In reply to
Have you looked at: http://www.php.net/...magic-quotes-gpc.php



Cheers - Dan Cool

----
Cheers,

Dan
Founder and CEO

LionsGate Creative
GoodPassRobot
Magelln
Quote Reply
Re: [Paul] Magic Quotes... In reply to
In Reply To:
I've done this before - its something like:

magic_quotes(0);

or:

magic_quotes_gpc(0);

can't remember exactly.



yip - i think this is the one here...

http://www.php.net/...c-quotes-runtime.php


or the one just above that.


r

Last edited by:

ryel01: May 13, 2002, 6:01 PM
Quote Reply
Re: [ryel01] Magic Quotes... In reply to
Hi. Thanks everyone...still no joy though :( I tried to set the use of magic quotes at the beginning of the script, but it still was determined to use them Frown

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy.] Magic Quotes... In reply to
What did you use?
Quote Reply
Re: [Andy.] Magic Quotes... In reply to
You can't change the magic_quotes option at runtime (I can't remember if you can change it with a .htaccess). This is how I deal with it in the Links SQL Front End:

Code:
# Check to see if magic_quotes_gpc is turned on, and if it is remove the slashes.
if (get_magic_quotes_gpc()) {
foreach ($data as $key => $val) {
$data[$key] = stripslashes($val);
}
}

$data being the array holding the POST/GET data.

Adrian