|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-07-10 23:44 UTC] simon at klashma dot no-ip dot com
<?
$usager = 'klashma'; // Username to log on the SQL server
$pwd = 'xx00xx'; // the password
$server = '{192.168.36.2:143}'; // the IMAP server string
$web_courriel = 'klashma.no-ip.com'; // the email for the IMAP logon (virtual host)
$sql_server_ip = '192.168.36.2'; // the IP of the SQL server.
function openSQL()
{
global $sql_server_ip, $usager, $pwd;
$sqllink = mysql_connect($sql_server_ip,$usager,$pwd);
if (!$sqllink)
{
print 'Access denied';
die();
}
}
function nbTEL()
{
/* the table is only a one colums table (ID) with integers. */
global $usager;
$result = mysql_db_query ($usager,"select id from prop");
$result = mysql_num_rows($result);
return $result;
}
function openIMAP($folder='INBOX')
{
global $usager,$pwd,$server,$web_courriel,$mbox;
$mbox = imap_open ($server . $folder, $usager.'@'.$web_courriel, $pwd) || die("Snif...: ".imap_last_error());
}
function nbEmail()
{
global $mbox;
if (($num_msg = imap_num_msg($mbox)) == 0)
{
return(0);
} else {
return $num_msg;
}
}
print 'Opening the IMAP first:<br>';
openIMAP('INBOX');
openSQL();
print nbTel() . '<br>';
print nbEmail() . '<br>';
mysql_close;
imap_close($mbox);
print 'Works great...<br>Now with SQL first:<br>';
openSQL();
openIMAP('INBOX');
print nbTel() . '<br>';
print nbEmail() . '<br>';
print 'Blah, pointer not found :(';
?>
-=-=-= http://klashma.no-ip.com/test.php =-=-=-=- for the script
-=-=-= http://klashma.no-ip.com/php.php =-=-=-=- a good old phpinfo();
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 17:00:01 2025 UTC |
What is the exact problem here? The url mentioned gives me: Opening the IMAP first: Warning: Couldn't open stream {192.168.36.2:143}INBOX in /www/htdocs/test.php on line 32 Snif...: Too many login failures But this could be anything (including the error which it gives me back ;) If still have a problem, please more detail. Also, first try if this still happens with latest RC http://www.php.net/~zeev/php-4.1.0RC3.tar.gz Feedback.