Thanks for your reply but for example, my problem is more like the following
php3:

<?
$login='';

Function login() {
 global $login;
 echo('<form enctype="multipart/form-data" method="post"
action="test.php3?s=1"');
 echo(' <p>Login</p><input type="text" name=login size="10">');
 echo('<input type="submit" value="Submit" name="B1">');
 echo('</form>');
}

function vrf_passwd($f1) {
 printf("Login=%s",$f1);
}

switch($s) {
 case 1:  vrf_passwd($login);
   break;
 default: login();
   break;
}
?>





"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > 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).
>
> It does.  You simply have to declare in the function you wish to access
> the global variable that you want the global variable by using the global
> keyword in that function.
>
> Please read the Variables Scope chapter in the manual:
>
> http://php.net/manual/en/language.variables.scope.php
>
> -Rasmus
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to