> Then you must 'get' the global variables (like $name):
>
> $name = "mOrP";
>
> function print_name()
> {
> global $name;
> echo $name;
> }
>
> print_name();
>
>
> But it's better to work with the function arguments:
>
> $name = "mOrP"
>
> function print_name($name_arg)
> {
> echo $name_arg;
> }
>
> print_name($name);
Ah, I see, so would something like this work:
$alias = "James";
$password = "MyPassword";
function check_alias_password($alias_arg, $password_arg)
{
if ((!$alias_arg) || (!$password_arg)) {
header("Location: login.php");
exit;
}
}
check_alias_password($alias, $password);
or
function check_alias_password()
global $alias, $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?
> Hope it helps,
It does, and your help is greatly appreciated ;)
James.
--
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]