Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jul 2002 19:59:52 +0100
From:      "Mark Hughes" <mh_lists@digitalspy.co.uk>
To:        "Roman Neuhauser" <neuhauser@bellavista.cz>, "Kjell - LA3SG" <kmidtset@c2i.net>
Cc:        <freebsd-questions@FreeBSD.ORG>
Subject:   Re: FreeBSD 4.6 can not serve PHP web pages
Message-ID:  <03ea01c22a9f$789b1030$0700a8c0@mark>
References:  <3D2FC6C6.7120.1EE0F3@localhost> <3D2FE2E7.6226.8CC77C@localhost> <20020713083347.GB322@freepuppy.bellavista.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > > 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 <form..> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?03ea01c22a9f$789b1030$0700a8c0>