> function check_alias_password()
>     global $alias, $password;

better:

        global $alias;
        global $password;

>     {
>         if ((!$alias) || (!$password)) {
>             header("Location: login.php");
>             exit;
>         }
>     }
>
> check_alias_password();
>
> work? Or would the last example need to be globals (variables) instead of
> global?


Yes, this will work - with the correction I've made, 'cause I'm not sure, if
you can assign two variables to 'global'...

But you can see, that it is not good to use the 'global' keyword, because
you must know the name of the variable, you use.

Look:


$name_1 = "Jan";
$name_2 = "Fritz";

function print_name($name_arg)
{
        echo $name_arg;
}

print_name($name_1);
print_name($name_2);


You see, how flexible it is...

CU
mOrP


-- 
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