您的位置:首页网页设计PHP实例 → 通过ICQ网关发送手机短信的PHP源程序

通过ICQ网关发送手机短信的PHP源程序

时间:2004/11/7 3:30:00来源:本站整理作者:蓝点我要评论(0)

通过ICQ网关发送手机短信的PHP源程序

(转自linuxforum.net 原作者:liushiliang EMAIL:  lsl@163.net )




//###########################################################

//

// For questions and comments

// Roland (alias -=: Vlieg :=-)

// icq #78354631

// mail: vlieg@atoomnet.net

//

// NB: This script won't work on free hosting pages, because of the secure mode!

// NB: You must have registered your ICQ# at http://web.icq.com/sms/login/ in order for this script to work

//###########################################################





//****************************************************************\//Config:



$uin=""; //your ICQ number

$passw=""; //your ICQpassword



$prefix=""; //sms prefix

$phonenumber=""; //sms phone number

$message = "Hello!"; //sms message





//****************************************************************\// EN: calculate the content length



$contentlength= ( 37+

strlen($uin)+

strlen($passw)

);



//****************************************************************\// Openen van de inlogpagina

// EN: open loginpage



$htmlreply="";

$post ="POST http://web.icq.com/karma/dologin/1,,,00.html HTTP/1.0

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*

Referer: http://web.icq.com/sms/login/1,,,00.html

Accept-Language: nl

Content-Type: application/x-www-form-urlencoded

Accept-Encoding: gzip, deflate

User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)

Host: web.icq.com

Content-Length: ".$contentlength."

Proxy-Connection: Keep-Alive

Pragma: no-cache

Cookie: uin=".$uin."; sms_country=".$prefix."; KarmaService1=Yes; uin=".$uin."; sms_country=".$prefix."; KarmaService1=Yes



uService=1&uLogin=".$uin."&uPassword=".$passw."&x=0&y=0";



$remote = fsockopen("web.icq.com", 80, &$errno, &$errstr, 30);



global $remote;

global $post;

fputs($remote, $post);



while (!feof($remote)) { $htmlreply.=fgets($remote,120); }

//UNCOMMENT FOR OUTPUT: echo "".htmlspecialchars($htmlreply)."";

fclose($remote);



//****************************************************************\//persoonlijke cookie uit de inlogpage halen

// EN: fetch personal cookie from login page



$splited = split("\n",$htmlreply);

$cookies = $splited[3];

$cookies = str_replace("Set-Cookie: KarmaLogin=","",$cookies);

$cookies = str_replace("; path=/","",$cookies);

$cookies = str_replace("\n","",$cookies);

//UNCOMMENT VOOR OUTPUT: echo $cookies;



if (strlen($prefix) == 2) { $contentprefix = ' '.$prefix; } else { $contentprefix = $prefix; }

$charcount = (160-strlen($message));

$contentlength= ( 1561+

strlen($message)+

strlen($charcount)+

strlen($phonenumber)+

strlen($prefix)

);



//****************************************************************\//Verzendpagina openen met de opgehaalde cookie

// EN: open send page with fetched cookie



$htmlreply="";

$post ='POST http://web.icq.com/sms/send_history/1,,,00.html HTTP/1.0

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*

Referer: http://web.icq.com/sms/send_session/1,,,00.html?prefix=+'.$prefix.'&carrier=&tophone='.$phonenumber.'

Accept-Language: nl

Content-Type: multipart/form-data; boundary=---------------------------7d12442eab4

Accept-Encoding: gzip, deflate

User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)

Host: web.icq.com

Content-Length: '.$contentlength.'

Proxy-Connection: Keep-Alive

Pragma: no-cache

Cookie: uin='.$uin.'; sms_country='.$prefix.'; KarmaService1=Yes; KarmaLogin='.$cookies.'; uin='.$uin.'; sms_country='.$prefix.'; KarmaService1=Yes; KarmaLogin='.$cookies.'



-----------------------------7d12442eab4

Content-Disposition: form-data; name="carrier"





-----------------------------7d12442eab4

Content-Disposition: form-data; name="prefix"



'.$contentprefix.'

-----------------------------7d12442eab4

Content-Disposition: form-data; name="tophone"



'.$phonenumber.'

-----------------------------7d12442eab4

Content-Disposition: form-data; name="uSession"



1

-----------------------------7d12442eab4

Content-Disposition: form-data; name="uReply"





-----------------------------7d12442eab4

Content-Disposition: form-data; name="uLastId"





-----------------------------7d12442eab4

Content-Disposition: form-data; name="uSend"



1

-----------------------------7d12442eab4

Content-Disposition: form-data; name="uNextId"





-----------------------------7d12442eab4

Content-Disposition: form-data; name="uHistoryCounter"



1

-----------------------------7d12442eab4

Content-Disposition: form-data; name="count"



0

-----------------------------7d12442eab4

Content-Disposition: form-data; name="uSubmitCount"



0

-----------------------------7d12442eab4

Content-Disposition: form-data; name="checkNewMsg"



180000

-----------------------------7d12442eab4

Content-Disposition: form-data; name="charcount"



'.$charcount.'

-----------------------------7d12442eab4

Content-Disposition: form-data; name="msg"



'.$message.'

-----------------------------7d12442eab4

Content-Disposition: form-data; name="x"



30

-----------------------------7d12442eab4

Content-Disposition: form-data; name="y"



16

-----------------------------7d12442eab4--

';



$remote = fsockopen("web.icq.com", 80, &$errno, &$errstr, 30);



global $remote;

global $post;

fputs($remote, $post);



while (!feof($remote)) { $htmlreply.=fgets($remote,120); }

//UNCOMMENT FOR OUTPUT: echo "".htmlspecialchars($htmlreply)."";

fclose($remote);



//****************************************************************\// check if message is send if send 'moved permanently' is returned



if (eregi('Moved Permanently',$htmlreply))

{ echo "Sms message successfully sent!"; }

else

{ echo "Sms not sent!"; }

?>


相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么

文章评论
发表评论

热门文章 没有查询到任何记录。

最新文章 我的php文件怎么打开_php运算符怎么写 php 如何生成静态页面的函数PHP生成图片缩略图PHP session常见问题集锦及解决办法PHP实现同步远程Mysql

人气排行 DEDE在文章列表文章没有缩略图的不显示图片php+mysq修改用户密码我的php文件怎么打开_如何打开php文件的办法FCKeditor的配置和使用方法使用dedecms建站教程PHP+Ajax实现分页技术图片存储与浏览一例Linux+Apache+PHP+MySQLPHP生成图片缩略图