I have the same problem but putting $var_name = $_GET['var_name'] didn't solve the problem. I put it on the top of the page (e.g. line no. 2) and I'm getting error: PHP Warning: Undefined index: var_name in F:\bhdanas.com\index.php on line 2
Any idea? Afan ----- Original Message ----- From: Shrock, Court To: brother ; '[EMAIL PROTECTED]' Sent: Thursday, May 09, 2002 1:07 PM Subject: RE: [PHP-WIN] register_globals and php 4.2 Replace all references of "$pagetype" with "$_GET['pagetype']" (without the doube-quotes, of course) or have the line "$pagetype = $_GET['pagetype']" at the beginning of your file. Repeat this same idea with your other variables and you should be okay. > -----Original Message----- > From: brother [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 09, 2002 5:11 AM > To: '[EMAIL PROTECTED]' > Subject: [PHP-WIN] register_globals and php 4.2 > > > I'm trying to rewrite my code so it will be useful under PHP 4.2. > the links at my site are in this format > index.php?pagetype=newsarchive&id=15&read=1 this will make > php to look fpr > the file /newsarchive/data.php and use the $id var to get the correct > newsline from the databse, however, when the register_globals > is set to off > I can't use this and I cann't figre out how to do it, HELP! > > the index.php starts with the code: > if (!isset($pagetype)) { > $pagetype = "news"; > } > > so all links displays the news page and that's not my goal =) > > /brother > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php