RE: [PHP-DB] Newbie Reminder on HTML Variable Passing - quick fix
| From: | Peter Lovatt | Date: | Sun, 07 Jul 2002 17:12:13 +0000 |
| Subject: | RE: [PHP-DB] Newbie Reminder on HTML Variable Passing - quick fix | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20371@lists.php.net to get a copy of this message | ||
hi
The enclosed will read all incoming variables and convert them, effectively
turning on 'register_globals'
It is a quick fix for broken scripts but does remove the security provided
by turning register_globals off !
use it as an include at the beginning of scripts.
Peter
<?php
#////////////////////////////////////////////////////////////
# #
# SunMaia.net RED #
# e-development at the speed of thought #
# #
# #
# This module copyright SunMaia.net 1999-2002 #
# author Peter Lovatt pjl@sunmaia.net #
# #
# http://www.sunmaia.net for full licence terms #
# support http://www.sunmaia.net/support/
#
# #
# You can do whatever you like with this so long #
# as this header remains in place #
# #
# It worked last time I used it, but it is not #
# guaranteed in any way! #
# #
# #
/////////////////////////////////////////////////////////////
while(list($key, $val) = each($HTTP_POST_VARS))
{
$$key = stripslashes($val);
}
while(list($key, $val) = each($HTTP_GET_VARS))
{
$$key = stripslashes($val);
}
while(list($key, $val) = each($HTTP_COOKIE_VARS))
{
$$key = stripslashes($val);
}
?>
-----------------------------------------------
Excellence in internet and open source software
-----------------------------------------------
Sunmaia
www.sunmaia.net
info@sunmaia.net
tel. 0121-242-1473
-----------------------------------------------
> -----Original Message-----
> From: Allens [mailto:ateam3@mac.com]
> Sent: 07 July 2002 16:53
> To: php-db@lists.php.net
> Subject: [PHP-DB] Newbie Reminder on HTML Variable Passing
>
>
> I just recently got back to work on my db's and found that html variable
> passing isn't working anymore. I did some research and fould that the
> core setting in PHP for register_globals is off by default now since
> 4.1.x. As a newbie, this stumped me. There are some new variables
> created by the PHP team to address this, but we need to change our code
> some. The url below helps explain some of this. Hope this helps some of
> the other newbies entering this environment that have been confused by
> this as I had been. :)
>
> http://www.php.net/release_4_1_0.php
> :)
> Gale L. Allen Jr
> Macintosh Support Specialist
> 865/947-5740
>
> "Remember, Love wins over all"
> (:
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>