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, htmlspecialchars is

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 a web

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: You

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 stuff that is to

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

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 up

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 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); } } And

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; return

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 input type=text, douse the below function make sence? Ben function unprep( $text ) { // Take data coming from the database an get it ready to be presented

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: input type=text