Hi, im conecting to an IMAP server, just to test the user and passwd.
If the user and passwd are correct the code, works BUT if they are not correct, it just aborts and it does no mere code.
This is what im doing, im using 1 function to return 1 if it conects or 0 if it fails.
This is the fc:
[file: Validate_user.php]
<?php
function CheckUser($IMAP_server,$user_name,$user_pass) {
$mbox=imap_open ($IMAP_server,$user_name,$user_pass,OP_HALFOPEN);
if ($mbox){
$r=1;
imap_close($mbox);
}
else{
$r=0;
}
return $r;
}
?>
and this where i call the fc:
[file: pos_login.php]
<?php
include ("./vars.php");
include ("./Validate_user.php");
$user_name="xxxxx";
$user_pass="xxxxxx";
if (!CheckUser($IMAP_server,$user_name,$user_pass)){
header("Location: ./login_error.html"); / Redirect browser /
exit;
}
else{
header("Location: ./login_ok.html"); / Redirect browser /
exit;
}
?>
this does not work, and if i use something like:
"imap_open(...) or header("Location: ./login_error.html");"
it doesnt work either.
anyone can give me a hand? PLEASE!
tkx in advance
😕