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

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

更新时间:2006年10月09日 00:00:00   作者:

通过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!"; }

?>

相关文章

1a1b05c64693fbf380aa1344a7812747.png

什么是PEAR?(第一篇)

第一章 爱好PHP者必喜欢PEAR2009-03-03

4f55910a645b073bc4fc65dc10dc14bd.png

前提是必须安装db类库包2009-03-03

0ea3c7666119d5615e582f823fb3fad6.png

MySQL数据库管理

数据库的启动与关闭,安全、访问控制和权限,数据库的备份与恢复,导入和导出记录2008-06-06

4f96a78db829b1556ff16de21e013c7a.png

PHP中在数据库中保存Checkbox数据(1)...2006-10-10

8cc1031babc6aff2319f1c6af8544aa0.png

在php中使用sockets:从新闻组中获取文章...2006-10-10

0c932a99bb7b6f23c937db507070cc7b.png

php最近比较热门,所以学习php的朋友也越来越多,这里整理下数据库的一些操作,需要的朋友可以参考下。2010-03-03

cca732bf65a93ed2ec0ac80c638460fe.png

PHP5 操作MySQL数据库基础代码,照样的记住,多谢几遍,就算是对数据库操作入门了。以后或以后学习一些字符串处理的方法就ok了。2009-09-09

2d9f31f2af7b675a3d153d2b7f1035a7.png

PHP+javascript模拟Matrix画面...2006-10-10

b452cee8ec5cd9e58ab98eba17281e59.png

php上传、管理照片示例...2006-10-10

f4838ec7e2d4da28e0b57d4e852dadd4.png

一个php作的文本留言本的例子(一)...2006-10-10

最新评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值