Re: [PHP] Magic quotes question (still driving me mad)

2005-01-27 Thread Ben Edwards
On Wed, 26 Jan 2005 13:07:34 -0800 (PST), Richard Lynch <[EMAIL PROTECTED]> wrote: > Ben Edwards wrote: > > On Tue, 25 Jan 2005 17:02:21 -0800, Chris <[EMAIL PROTECTED]> > > wrote: > >> You should probably use get_magic_quotes_runtime() , as _gpc only > >> applies to GET/POST/COOKIE, > >> > >> htm

Re: [PHP] Magic quotes question (still driving me mad)

2005-01-26 Thread Richard Lynch
Ben Edwards wrote: > On Tue, 25 Jan 2005 17:02:21 -0800, Chris <[EMAIL PROTECTED]> > wrote: >> You should probably use get_magic_quotes_runtime() , as _gpc only >> applies to GET/POST/COOKIE, >> >> htmlspecialchars is needed so the HTML can be parsed properly: > > So this is this only done to stuf

RE: [PHP] Magic quotes question (still driving me mad)

2005-01-26 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm > -Original Message- > From: Ben Edwards [mailto:[EMAIL PROTECTED] > Sent: 26 January 2005 10:15 > > On Tue, 25 Jan 2005 17:02:21 -0800, Chris > <[EMAIL PROTECTED]> wrote:

Re: [PHP] Magic quotes question (still driving me mad)

2005-01-26 Thread Ben Edwards
On Tue, 25 Jan 2005 17:02:21 -0800, Chris <[EMAIL PROTECTED]> wrote: > You should probably use get_magic_quotes_runtime() , as _gpc only > applies to GET/POST/COOKIE, > > htmlspecialchars is needed so the HTML can be parsed properly: So this is this only done to stuff that is to be displayed on

Re: [PHP] Magic quotes question

2005-01-25 Thread Chris
You should probably use get_magic_quotes_runtime() , as _gpc only applies to GET/POST/COOKIE, htmlspecialchars is needed so the HTML can be parsed properly: if the value in the text box was something like: "> Hello World! when you go to put in the value attribute it would end up: Hello World!"

Re: [PHP] Magic quotes question

2005-01-25 Thread Ben Edwards
PS. How does htmlspecialchars fit into this. The unprep function is to prepare date coming from the database to be used in http://www.gurtlush.org.uk/profiles.php?uid=4 (email address this email is sent from may be defunct) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

Re: [PHP] Magic quotes question

2005-01-25 Thread Richard Lynch
Ben Edwards wrote: > OK. This is really confusing me. > > I am using the following function to handle this: > > function prep( &$text ) { > echo get_magic_quotes_gpc()." "; > if (get_magic_quotes_gpc()) { > echo "mq on for $text"; > return $text; > } else { > echo "mq off"; > ret

Re: [PHP] Magic quotes question

2005-01-25 Thread Ben Edwards
OK. This is really confusing me. I am using the following function to handle this: function prep( &$text ) { echo get_magic_quotes_gpc()." "; if (get_magic_quotes_gpc()) { echo "mq on for $text"; return $text; } else { echo "mq off"; return addslashes($text); }

Re: [PHP] Magic quotes question

2005-01-25 Thread Chris
I'm not quite sure I understand you... The theory behind that function looks sound, but are you meaning to return the value or pass it by reference and modify it? Chris Ben Edwards wrote: OK. This is really confusing me. I am using the following function to handle this: function prep( &$text ) {

Re: [PHP] Magic quotes question

2005-01-25 Thread Richard Lynch
Ben Edwards wrote: > In the php manual it states > > ' Keep in mind that the setting magic_quotes_gpc will not work at > runtime.' > > What douse this actualy mean? Translation: If you try to use ini_set to change magic_quotes_gps in your .php script, here's what happens: Step 1: Apache/PHP set

Re: [PHP] Magic quotes question

2005-01-25 Thread Chris
It means that you can't set that setting inside a script with ini_set. Since the earliest opportunity to set it in a script would be after it would have already done it's job, it won't work. You must set it before the script runs. Chris Ben Edwards wrote: In the php manual it states ' Keep in m

[PHP] Magic quotes question

2005-01-25 Thread Ben Edwards
In the php manual it states ' Keep in mind that the setting magic_quotes_gpc will not work at runtime.' What douse this actualy mean? Ben -- Ben Edwards - Poole, UK, England WARNING:This email contained partisan views - dont ever accuse me of using the veneer of objectivity If you have a prob