Re: global variables or not??

From: Date: Fri, 13 Sep 2002 09:58:26 +0000
Subject: Re: global variables or not??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-116250@lists.php.net to get a copy of this message
No you shouldn't. Define : $rd1 = $_POST['rd1']; $rd2 = $_POST['rd2']; at the begining of your scripts. http://www.php.net/manual/en/security.registerglobals.php -- Nicos - CHAILLAN Nicolas nicos@php.net www.WorldAKT.com - Hébergement de sites Internet "Skitum" <skitum@hotmail.com> a écrit dans le message de news: OE34LqIfQdmEB4HGXAw000001fa@hotmail.com... Hi all, Help me please. I need $vartwo1 have the same value that $varone1. Look: function one(){ ?> <input type="radio" name="checar" value="rd1"> <input type="radio" name="checar" value="rd2"> <input type="submit" name="button"> <? } function two(){ $vartwo1=$varone1; $vartwo2=$vartwo2; ----- HTML code --------- } if(isset($button)) { if($checar == rd1) { $varone1="blabla"; $varone2="bla"; two(); } elseif($checar == rd2) { $varone1="bleble"; $varone2="ble"; } else { otherfunction(); } } Should i use global variables? How should i use it? Thanks in advance. Peace & Love skitum

« previous php.general (#116250) next »