Re: [PHP] Problem with quotes

2008-02-21 Thread Casey
On Thu, Feb 21, 2008 at 8:04 PM, Mário Gamito <[EMAIL PROTECTED]> wrote: > Hi, > > Sorry for such a laim question. > > > > I have this code: > > $host = 'http://' . $_SERVER['HTTP_HOST']; > > "foreach($browser as $key => $val){ > echo "" . " "; > (...) " > > > but it has a bu

RE: [PHP] Problem with quotes

2008-02-21 Thread Andrés Robinet
> -Original Message- > From: Mário Gamito [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 21, 2008 11:04 PM > To: php-general@lists.php.net > Subject: [PHP] Problem with quotes > > Hi, > > Sorry for such a laim question. > > > > I have this

[PHP] Problem with quotes

2008-02-21 Thread Mário Gamito
Hi, Sorry for such a laim question. I have this code: $host = 'http://' . $_SERVER['HTTP_HOST']; "foreach($browser as $key => $val){ echo "" . " "; (...) " but it has a bug, I need to add the server domain before the picture, so I did: $host = 'http://' . $_SERVER['HTTP

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread afan
My thought was to use this until I do all changes. Once the changes are done - turn off magic_quote_gpc in php.ini. but, agree, redo whole site on separate place (under 'new' or on other box) is much better solution. -afan > On Thu, August 10, 2006 7:54 am, [EMAIL PROTECTED] wrote: >> This is w

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread Richard Lynch
On Thu, August 10, 2006 7:54 am, [EMAIL PROTECTED] wrote: > This is what I found and started to use: created magic_quotes_off.php > > if (get_magic_quotes_gpc()) > { > function stripslashes_deep($value) > { > $value = is_array($value) ? > array_map('str

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread afan
good idea! :) thanks richard! -afan > On Wed, August 9, 2006 9:07 am, [EMAIL PROTECTED] wrote: >> Have a web site on server where magic quote is turned On. Because of >> problems with quotes within forms, I was thinking to turn it Off. I >> wonder >> how much work I'll have to change code to acc

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread Richard Lynch
On Wed, August 9, 2006 9:07 am, [EMAIL PROTECTED] wrote: > Have a web site on server where magic quote is turned On. Because of > problems with quotes within forms, I was thinking to turn it Off. I > wonder > how much work I'll have to change code to accept new setting? Are we > talking about major

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread afan
This is what I found and started to use: created magic_quotes_off.php if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread afan
hm. good idea. actually, it's, at least, the most safe way. :) thanks. -afan > [EMAIL PROTECTED] wrote: >> Hi to all. >> >> Have a web site on server where magic quote is turned On. Because of >> problems with quotes within forms, I was thinking to turn it Off. I >> wonder >> how much work I'll

Re: [PHP] problem with quotes (single and double) in forms

2006-08-10 Thread Ivo F.A.C. Fokkema
In case anyone's interested, here's the function I use in the open source project LOVD to undo Magic Quoting on all GPC arrays: function lovd_magicUnquote ($var = '') { if (!$var) { if (count($_GET)) { lovd_magicUnquote(& $_GET); } if (count($_POST)) {

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread Chris
Chris wrote: Chris wrote: J R wrote: try to use this few lines of code. function stripMagicQuotes(&$var) { if (get_magic_quotes_gpc()) { $var= stripslashes($var); } return $var; } this way you don't really have to worry if magic quotes is on or off. Then he has to modify

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread J R
here's an improvement jwith recursion: function stripMagicQuotes(&$var) { if (get_magic_quotes_gpc()) { if(!is_array($var)) { $var= stripslashes($var); } else { array_walk($var, stripMagicQuotes); } } return $var; } hth, john On 8/10/06, C

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread Chris
Chris wrote: J R wrote: try to use this few lines of code. function stripMagicQuotes(&$var) { if (get_magic_quotes_gpc()) { $var= stripslashes($var); } return $var; } this way you don't really have to worry if magic quotes is on or off. Then he has to modify all the code

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread Chris
J R wrote: try to use this few lines of code. function stripMagicQuotes(&$var) { if (get_magic_quotes_gpc()) { $var= stripslashes($var); } return $var; } this way you don't really have to worry if magic quotes is on or off. Then he has to modify all the code to call that f

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread J R
try to use this few lines of code. function stripMagicQuotes(&$var) { if (get_magic_quotes_gpc()) { $var= stripslashes($var); } return $var; } this way you don't really have to worry if magic quotes is on or off. ** On 8/10/06, Chris <[EMAIL PROTECTED]> wrote: [EMAIL PROTE

Re: [PHP] problem with quotes (single and double) in forms

2006-08-09 Thread Chris
[EMAIL PROTECTED] wrote: Hi to all. Have a web site on server where magic quote is turned On. Because of problems with quotes within forms, I was thinking to turn it Off. I wonder how much work I'll have to change code to accept new setting? Are we talking about major changes or something that c

[PHP] problem with quotes (single and double) in forms

2006-08-09 Thread afan
Hi to all. Have a web site on server where magic quote is turned On. Because of problems with quotes within forms, I was thinking to turn it Off. I wonder how much work I'll have to change code to accept new setting? Are we talking about major changes or something that could be done in day or two