Re: Re: Migration from register_globals=on to register_globals=off
| From: | Justin French | Date: | Tue, 03 Jun 2003 15:41:40 +0000 |
| Subject: | Re: Re: Migration from register_globals=on to register_globals=off | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150003@lists.php.net to get a copy of this message | ||
on 04/06/03 3:02 AM, Øystein Håland (ha@ematte.se) wrote:
> I'm not sure what you mean. To give ONE example:
> Earlier I could use this code on top of every page:
> if ($printout != "yeah") { include("header.php"); }
> This code gives an error today. The variable $printout is set if the visitor
> choose to click on the 'print_page_image', otherwise the variable has no
> value.
instead of looking for $printout, you need to be lookign for
$_POST['printout'] (for posted vars from a form), $_GET['printout'[ for vars
in the url, $_SESSION[...], $_COOKIE[...], etc.
if($_GET['printout'] != "yeah") { include("header.php"); }
Alternately, if you don't want to dig through old code, you could
a) turn register globals back on via a .htaccess file for SOME
sites/directories/domains
b) do something like
$printout = $_GET['printout'];
$id = $_GET['id'];
etc
c) see this example i wrote:
http://www.weberdev.com/get_example.php3?count=3639
Does the above helps
Justin