Re: Passing vars between functions (with POSTs)

From: Date: Wed, 16 May 2001 18:22:59 +0000
Subject: Re: Passing vars between functions (with POSTs)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-53088@lists.php.net to get a copy of this message
Thanks for your reply. I've tried other ways but my problem still continues... I can not pass $login var out of the function. I don't have this problem in the two previous functions because I pass this variable as function argument, but this last function that doesn't have arguments I can't see the $login (even if is setup on the previous function as global). I don't know why I PHP doesn't allow to setup a $login as global to all functions (this will solve this problem). Chain of functions that are using this $login are: login() <---- Html form post to get the login and passed vfy_passwd($login, $passwd) <--- verify the login and passwd on DB menu_user($login) <---- If the login and passwd are correct the user gets a menu with options and on the top shows his login name (html form post). add_new_query() <---- One of the menu options (The problem is in here) If PHP recognize $login as global, the last function would have $login, but this doesn't happens. Miguel miguel.ribeiro@ftse.com ""Chris Lee"" <lee@mediawaveonline.com> wrote in message news:9ds0ki$55i$1@toye.p.sourceforge.net... this will ensure that the variable is a POST var vs a GET var too... function test() { global $HTTP_POST_VARS; echo $HTTP_POST_VARS['login']; } -- Chris Lee lee@mediawaveonline.com ""Miguel Ribeiro"" <miguel.ribeiro@ftse.com> wrote in message news:9dpgkk$mdb$1@toye.p.sourceforge.net... Hi, I'm struggling to pass from 3 functions (and one of them have a html form POST) one simple variable called $login. Once in the function (that have form with POST) is calling a php3 without passing the $login (like: common.php3&login='someone') and since the next function doesn't have any relation with this one (doesn't receive any value by return) but requires the same variable ($login). My question and great doubt is: How can I share $login in several functions... without use or change (because I don't have access) the PHP configuration environment... I believe that this could be solve with register_globals var but I don't know how to do it. Best Regards, Miguel -- 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 -- 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 (#53088) next »