PHP Source Code of /popview.php3
--------------------------------------------------------------------------------
Last Modified: 09:30 AM 07/06/1999 Print Date: 03:39 AM 07/12/1999 Size: 2874
--------------------------------------------------------------------------------
";
$fp=fsockopen( "localhost",110);
if ($fp>0){
echo "File Pointer:".$fp. "
";
echo "POP Connect
";
flush();
$charsput=fputs($fp, "USER ".$PHP_AUTH_USER. "\r\n");
if (!$charsput)
{
echo "
Error Occurred while sending request!
";
}else {
$connectmsg=fgets($fp,128);
if ( ord($connectmsg)==ord( "+")){
echo( "
Connect
".$connectmsg. "
");
}
//See if we got a Good Connection
if ( ord(fgets($fp,128))==ord( "+")){
//We didn't get an error (User name accepted)
echo( "
User Name Accepted!");
fputs($fp, "PASS ".$PHP_AUTH_PW. "\r\n");
//Try the password
$passwdattempt=fgets($fp,128);
if ( ord($passwdattempt)==ord( "+")){
//Password accepted
echo( "
Password accepted!
");
//echo("
".$passwdattempt."
");
//+ok mailbox open
//get the number of messages
$string=$passwdattempt;
$tok=strtok($string, " ");
while($tok){
if (strval($tok)>0){
$nMsgCount=strval($tok);
}
if ($nMsgCount>0) {
break;
} else {
$tok=strtok( " ");
}
}
if ($nMsgCount==1){
echo( "Mike, you have ".$nMsgCount. " message");
} elseif ($nMsgCount>0) {
//We have many messages
echo( "Mike, you have ".$nMsgCount. " messages!");
} else {
echo( "Mike, you have NO messages");
}
}
}
echo( "
");
fputs($fp, "QUIT". "\r\n");
// while(!feof($fp)) {
// echo fgets($fp,128);
// }
// fclose($fp);
printf(fpassthru($fp));
// for ($i=0;$i<=10;$i++)
// {
// $Response=fgets((int)$fp,100);
//echo $Response."
".fgets((int)$fp,100)."
".fgets((int)$fp,100);
//echo "
Complete
";
//fputs($fp,"?\r\n");
//echo fgetc(int)$fp,1);
//}
}
} else {
echo "Error connecting to pop server.";
}
//if ($fp){
// if (!fclose($fp)){
// echo "Error closing Connection to printer";
// } else {
// echo "Printer closed successfully";
// }
//}
?>
--------------------------------------------------------------------------------
The syntax highlighted source is automatically generated by PHP from the plaintext script. If you want to see the source of source.php3, have a look here.