
why is imap_open not working for a login check?
According to the php manual, imap_open will Return an IMAP stream on
success and FALSE on error. Is there a function I can put around
imap_open to return true if there is a stream or return false if ther
eis no stream? I dont want to store the password anywhere on the
system, so I want to test it by checking if I get an imap stream or
not.. Here is the code I wrote, it will work if there is a way I can
return true or false whether there is a stream. thanks:
if(imap_open($IMAP_SERVER,$username,$password))
return true;
Quote:
}else{
$alerts = imap_alerts();
$errors = imap_errors();
$x = count($alerts);
$y = count($errors);
if($x > 0){
for($i=0;$i<$x;$i++){
echo $alerts[$x] ."<br>";
}
}
if($y > 0){
for($i=0;$i<$y;$i++){
echo $errors[$y] ."<br>";
}
}
return false;}
}else{
return false;
}