Dear Faisal ,
the following URL explain the meaning of
http://ua2.php.net/manual/en/function.fsockopen.php

I never use the fsockopen, it used to Open Internet socket connection,
the first parameter used to specify the target(URL).
the second parameter define the port for connection.
the 3rd and 4th parameters is  error number, and error message used when the connection failed.
the  5th  parameter is a time out for reading and writing data over the socket.



fputs : returns the number of bytes written, or false on error
see: http://ua2.php.net/manual/en/function.fputs.php

regards,
hafez
------------------------------------------------------------------------------------------------------------------




 

Message: 6
Date: Thu, 2 Feb 2006 11:45:15 +0200
From: Al-Faisal El-Dajani < [EMAIL PROTECTED]>
Subject: [JoLUG-General] PHP Help
To: Jordan Linux User Group Mailing list <[email protected]>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

Hey PHP gurus,

Here is some PHP code that checks for the status of a person using AIM (AOL
Instant Messenger)...I can get the general idea of the code, but can some
php guy explain to me the different parameters and what they are for?
Of speical interest to me is the fsockopen statement. And what does the
fputs statement return??
I'm trying to understand it to rewrite it in Tcl :(

<?
// Connect to AOL server
$url = "" big.oscar.aol.com", 80, &$errno, &$errstr, 3);

// Query the Server
fputs($url, "GET /spoonosupport? HTTP/1.0\n\n");

// See resultant page
while(!feof($url)){
        $feofi++;
        $page .= fread($url,256);
        if($feofi > 10){
                $page = "offline";
                break;
        }
}
fclose($url);

// determine online status
if(strstr($page, "online")){
        echo "the user is online";
}else{
        echo "the user is offline";
}
?>

thanx
--
Al-Faisal El-Dajani
Tel: +962-7-77 799 781
P.O Box: 140056
11814 Amman, Jordan

May the source be with you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.jolug.org/pipermail/general_jolug.org/attachments/20060202/eedcd48c/attachment.html

------------------------------

_______________________________________________
General mailing list
[email protected]
http://mail.jolug.org/mailman/listinfo/general_jolug.org


End of General Digest, Vol 17, Issue 3
**************************************



--
Hafez A.Ahmad
Amman-Jordan
mobile:962-795101051
_______________________________________________
General mailing list
[email protected]
http://mail.jolug.org/mailman/listinfo/general_jolug.org

Reply via email to