Help!
I have another page with a form where the user logs in this their email address and email address password. $mail and $password variables are being passed to this page because if I do a print $mail; at the top of the page, the value of $mail and $password is printed. I also bind to the e-mail systems ldap directory. The value of $mail is not being passed to the cookie. If I print $email or $mail, no value prints????????
Does anyone know what I'm doing wrong? Thanks,
Jamie
<?
ob_start();
function ldap()
{
$ds=ldap_connect("ldap.apigroupinc.com");
$email_address = "mail=$mail";
$r=ldap_bind($ds, $email_address, $password);
if ($r == "1")
{
$email = $mail;
SetCookie("user_login", $email, Time()+16070400);
print $email; //nothing shows up here?????
}
else
{
echo "Did not connect to the ldap server.";
}
}
if (!"$user_login") {
ldap();
}
else {
echo "you are logged in already";
echo $user_login;
}
?>