php3-list | 199807
Date: 07/14/98
- Next message: Martin Koistinen: "RE: [PHP3] OK, Kill me if this can;t be done, but:"
- Previous message: Christopher Curtis: "RE: [PHP3] Example of du"
- In reply to: Adam Roderick: "[PHP3] some more socket trouble"
- Next in thread: Cameron Just: "Re: [PHP3] some more socket trouble"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Well, you're probably getting tired of hearing from me, but I still cannot
> retrieve any information beyond the first line of the socket connection.
> Here's a copy of my code:
Ok, I just wrote myself a little test version of what you are trying to
do. It worked fine. I don't think you are doing your fputs() and your
fgets() calls at the right time. Or maybe you are forgetting to send a
carriage return in your fputs().
Here is the little script which works fine for me:
<?
$host = "XXX";
$id = "XXX";
$password = "XXX";
$fp=fsockopen($host,110);
$cmd="user";
while(!feof($fp)) {
switch($cmd) {
case "user":
fputs($fp,"user $id\n");
$cmd = "pass";
break;
case "pass":
fputs($fp,"pass $password\n");
$cmd = "list";
break;
case "list":
fputs($fp,"list\n");
$cmd = "quit";
$break;
case "quit":
fputs($fp,"quit\n");
$break;
}
$reply = fgets($fp,80);
echo $reply;
}
fclose($fp);
?>
By the way, you would be much better off using the imap.so module for
this. It supports talking to POP servers.
-Rasmus
-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.tryc.on.ca/php3.html
- Next message: Martin Koistinen: "RE: [PHP3] OK, Kill me if this can;t be done, but:"
- Previous message: Christopher Curtis: "RE: [PHP3] Example of du"
- In reply to: Adam Roderick: "[PHP3] some more socket trouble"
- Next in thread: Cameron Just: "Re: [PHP3] some more socket trouble"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

