Hi,
I include the following function:
<?php
function login($members_ only) {
if (isset($_COOKIE['login'])) {
$login = explode("|split |",$_COOKIE['login']);
$login = array("username "=>$login[0],"password"=>$l ogin[1]);
}
else if ($members_only == 1) {
header("Locatio n: login.php");
}
}
?>
in a file called account.php:
<?php
require("websit e-includes/login.inc.php") ;
login(1);
[snip]
?>
The problem is that I need to be able to access $login outside of the
function within the page that calls it. Is this possible? I'm new to
functions and before I was just including code, but I am told functions are
better.
TIA
I include the following function:
<?php
function login($members_ only) {
if (isset($_COOKIE['login'])) {
$login = explode("|split |",$_COOKIE['login']);
$login = array("username "=>$login[0],"password"=>$l ogin[1]);
}
else if ($members_only == 1) {
header("Locatio n: login.php");
}
}
?>
in a file called account.php:
<?php
require("websit e-includes/login.inc.php") ;
login(1);
[snip]
?>
The problem is that I need to be able to access $login outside of the
function within the page that calls it. Is this possible? I'm new to
functions and before I was just including code, but I am told functions are
better.
TIA
Comment