PHP写的ICQ呼机
时间:2007-02-17 来源:PHP爱好者
改下地址,可以呼OICQ的喔!
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
<?
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
# ICQ Pager v0.0.1
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
# Brazil r0x.
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
# thanks goes to upalele, meganha, neo, figui, lunetta and vipman(for his psychological help about iX[Egg])
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
class icqpager {
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
var $path = "/scripts/WWPMsg.dll";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
var $host = "wwp.icq.com";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
var $port = 80;
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
var $cmd;
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
function icqpager() {
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd = "POST $this->path HTTP/1.1rn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*rn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Accept-Language: en-usrn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Content-Type: application/x-www-form-urlencodedrn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Accept-Encoding: gzip, deflatern";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95)rn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Host: $this->hostrn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
}
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
function send($uin, $from, $email, $subject, $message) {
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$command = "from=" . $from . "&fromemail=" . $email . "&subject=" . $subject . "&body=" . $message . "&to=" . $uin . "&Send=Send+Message";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Content-Length: " . strlen($command) . "rn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Connection: Keep-Alivernrn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= $command . "rnrn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$fp = fsockopen ($this->host, $this->port, &$errno, &$errstr, 30);
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
if (!$fp) {
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
echo "Socket Error.<br>n";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
echo "$errstr ($errno)<br>n";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
} else {
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
fputs($fp, $this->cmd);
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
fclose($fp);
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
}
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
}
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
}
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
?>
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
Example
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
<?
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
require("icqpager.php");
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$uin = "YOUR UIN NUMBER HERE";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$from = "root";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$email = "root@localhost";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$subject = "test";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$message = "testing... 1...2...3...";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$icqpager = new icqpager();
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$icqpager->send($uin, $from, $email, $subject, $message);
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
?>
php爱好者站 http://www.phpfans.net Linux|Apache|IIS.
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
<?
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
# ICQ Pager v0.0.1
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
# Brazil r0x.
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
# thanks goes to upalele, meganha, neo, figui, lunetta and vipman(for his psychological help about iX[Egg])
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
class icqpager {
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
var $path = "/scripts/WWPMsg.dll";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
var $host = "wwp.icq.com";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
var $port = 80;
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
var $cmd;
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
function icqpager() {
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd = "POST $this->path HTTP/1.1rn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*rn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Accept-Language: en-usrn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Content-Type: application/x-www-form-urlencodedrn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Accept-Encoding: gzip, deflatern";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95)rn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Host: $this->hostrn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
}
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
function send($uin, $from, $email, $subject, $message) {
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$command = "from=" . $from . "&fromemail=" . $email . "&subject=" . $subject . "&body=" . $message . "&to=" . $uin . "&Send=Send+Message";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Content-Length: " . strlen($command) . "rn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= "Connection: Keep-Alivernrn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$this->cmd .= $command . "rnrn";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$fp = fsockopen ($this->host, $this->port, &$errno, &$errstr, 30);
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
if (!$fp) {
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
echo "Socket Error.<br>n";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
echo "$errstr ($errno)<br>n";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
} else {
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
fputs($fp, $this->cmd);
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
fclose($fp);
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
}
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
}
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
}
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
?>
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
Example
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
<?
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
require("icqpager.php");
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$uin = "YOUR UIN NUMBER HERE";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$from = "root";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$email = "root@localhost";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$subject = "test";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$message = "testing... 1...2...3...";
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$icqpager = new icqpager();
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
$icqpager->send($uin, $from, $email, $subject, $message);
chin a i t p oe er . co mtfjlwRYKpHkjxBRgCHl8pkn9f
?>
php爱好者站 http://www.phpfans.net Linux|Apache|IIS.
相关阅读 更多 +