Re: register_globals=off

From: Date: Sun, 03 Dec 2000 16:30:11 +0000
Subject: Re: register_globals=off
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-28447@lists.php.net to get a copy of this message
That's correct, Todd. The "preferred" setup for PEAR (code repository comparable to Perl's CPAN) is not to use variables that were created by register_globals=on. That way, if somebody doens't have that feature turned on, the distributed code will still work without changes. However, you may prefer to use register_globals =on as long as you're not going to be passing code around a lot. I commonly switch between the two in different projects, depending on the project. It's really up to you. Registered globals are quicker to type, while HTTP_*_VARS[] is more readily portable from system to system. Hope this helps. Toby Butzon [ criticism spurs improvement ] ----- Original Message ----- From: "Todd Cary" <todd@aristesoftware.com> To: <php-general@lists.php.net> Sent: Sunday, December 03, 2000 11:24 AM Subject: [PHP] register_globals=off : As a newbie to PHP and HTTP, I am somewhat confused about passing data : between pages. Currently, I have register_globals =Off and : track_vars=On. Then I use Hidden POST fields to pass the data and : $HTTP_POST_VARS[] to retrieve it. : : If I have register_globals=On, then I would not have to use : $HTTP_POST_VARS[], correct? : : What is the preferred setup? : : +++ : : Another question I have is about passing data using Sockets. In some : situations I will check for a variable and then want to Jump to another : page. For example, if CancelBtn=Cancel (the cancel button was pressed : on a form), I will open a socket. Here is an example: : : file://This will open a socket and send the data to DisplayPhotos : if ($CancelBtn) { : $http = new http; file://Use class : : $fp = $http->http_fget("209.204.172.137", $path . "Review.php?" . : "SID=" . $sessionid . : "&PhotoSet=" . $PhotoSet . : "&clFirst=" . urlencode($clFirst) . : "&clLast=" .urlencode($clLast) . : "&selCompany=" . urlencode($selCompany) . : "&selTime=" . urlencode($selTime) . : "&TripDate=" . urlencode($TripDate)); : if($fp) { : print '<BASE HREF="' . $url . 'Review.php"><p>'; : fpassthru($fp); : }; : exit; : }; : : Is there a better method for doing this? : : Many thanks........... : : Todd : : -- : Todd Cary : Ariste Software : todd@aristesoftware.com : : : : -- : PHP General Mailing List (http://www.php.net/) : To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net : For additional commands, e-mail: php-general-help@lists.php.net : To contact the list administrators, e-mail: php-list-admin@lists.php.net : :

« previous php.general (#28447) next »