From owner-freebsd-questions Sat Jul 13 12: 0:37 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A38DC37B400 for ; Sat, 13 Jul 2002 12:00:35 -0700 (PDT) Received: from dylan.digitalspy.co.uk (dylan.digitalspy.co.uk [212.42.1.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CCAB43E65 for ; Sat, 13 Jul 2002 12:00:35 -0700 (PDT) (envelope-from mh_lists@digitalspy.co.uk) Received: from mark (pc-62-31-190-12-du.blueyonder.co.uk [62.31.190.12]) by dylan.digitalspy.co.uk (Postfix) with SMTP id 7383693107; Sat, 13 Jul 2002 20:00:35 +0100 (BST) Message-ID: <03ea01c22a9f$789b1030$0700a8c0@mark> From: "Mark Hughes" To: "Roman Neuhauser" , "Kjell - LA3SG" Cc: References: <3D2FC6C6.7120.1EE0F3@localhost> <3D2FE2E7.6226.8CC77C@localhost> <20020713083347.GB322@freepuppy.bellavista.cz> Subject: Re: FreeBSD 4.6 can not serve PHP web pages Date: Sat, 13 Jul 2002 19:59:52 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > > > calling up the page > > > > http://my.site.com/page.php?a=5 from my browser, > > > > or my.site.com/page.php?a=5 in a tag, a > > > > is undefined when page.php is entered. IE > > > > arguments are not passed. > > > > > > http://www.php.net/release_4_2_0.php > > > > Yes. I see. Thank you! > > Looks like I have to make an average of 56 changes in 678 > > routines! And 56 * 678 =? > > ------------------------------------ > > ** The biggest change in PHP 4.2.0 concerns variable handling. > ** External variables (from the environment, the HTTP request, > ** cookies or the web server) are no longer registered in the > ** global scope by default. The preferred method of accessing > ** these external variables is by using the new Superglobal > ** arrays, introduced in PHP 4.1.0. > > I don't see where it says you can't have the old behavior. > This has been configurable since I remember (which is 4.0b3). > Just change the value of register_globals in php.ini to "On", > and your code works as before. Yup - you can also do that on a script level with the command: ini_set("register_globals",1); provided it's not running in safe mode. I do recommend changing your scripts over to use the new superglobal arrays though - it only need be at the start of each script, put something like $orignalvariablename=$_POST["orignalvariablename"]; for each variable you want to get from a post, likewise for get and cookies - this will give you the security advantages of knowing what the variables have been set from (the whole point behind not using register globals), and only requires a fairly small change to the script. I'm working through mine at the moment... it is taking a while, but it's worth doing IMO. Mark To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message