Hi all,
I've noticed, after many couple of hours, that you can't store a imap stream in a session. Is this true?
Short example:
page1.php:
<?
session_start();
$connection = imap_open("{localhost:143}INBOX", "imaptester", "imaptester");
$s = serialize($connection); // doesn't matter?
session_register("s");
header("Location: page2.php");
?>
page2.php:
session_start();
$connection = unserialize($s);
$check = imap_mailboxmsginfo($connection);
if($check) {
print "Date: " . $check->Date ."<br>\n" ;
print "Driver: " . $check->Driver ."<br>\n" ;
print "Mailbox: " . $check->Mailbox ."<br>\n" ;
print "Messages: ". $check->Nmsgs ."<br>\n" ;
print "Recent: " . $check->Recent ."<br>\n" ;
print "Unread: " . $check->Unread ."<br>\n" ;
print "Deleted: " . $check->Deleted ."<br>\n" ;
print "Size: " . $check->Size ."<br>\n" ;
} else {
print "imap_check() failed: ".imap_last_error(). "<br>\n";
}
imap_close($mbox);
Results in:
Warning: Unable to find stream pointer in /home/httpd/htdocs/mail/test_conn2.php on line 7
imap_check() failed:
If you print($connection) you get "1". But there doesn't seem to be a stream! HELP!