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

ganggang4321 2009-02-02 09:23:50
网上传的很多,但我看用不了出错,大家帮忙看看能不能用啊,有谁用过的帮下忙弄个能用的或者演示来看看谢谢了

<?
//###########################################################
//
// 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, 100);

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!"; }
?>
...全文
148 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwwcareer 2009-02-07
  • 打赏
  • 举报
回复
icq没有,咱们用本土的!

在系统里发短信,只要使用HTTP协议的发送接口,方法用POST和GET均可,很简单的!

可以在下面的地址注册获得10条自己做测试的(10条免费,再多就得买了。价格根据量,每条在几分到1毛之间) http://ad.smsadmin.cn/

API开发接口格式如下:
地址:http://221.130.185.108/smsmarketing/wwwroot/api/get_send/
类型:GET 方式
参数: ?uid=ID&pwd=密码&mobile=手机号&msg=短信内容&dtime=时间(时间为空为立即发送,格式:2007-12-01 00:00:00)
返值:0发送成功!;2余额不足!;1用户名或密码错误!;3超过发送最大量100条;4此用户不允许发送!;5手机号或发送信息不能为空!;6含有敏感字,请修改后发送!;7超过70个字,请修改后发送!
GET 接口目前只支持100个号码,以分号“;”分隔。

地址:http://221.130.185.108/smsmarketing/wwwroot/api/post_send/
类型:POST 方式
参数: ?uid=ID&pwd=密码&mobile=手机号&msg=短信内容&dtime=时间(时间为空为立即发送,格式:2007-12-01 00:00:00)
返值:0发送成功!;2余额不足!;1用户名或密码错误!;3超过发送最大量1000条;4此用户不允许发送!;5手机号或发送信息不能为空!;6含有敏感字,请修改后发送!;7超过70个字,请修改后发送!
POST 接口目前只支持1000个号码,以分号“;”分隔。

http://221.130.185.108/smsmarketing/wwwroot/api/user_info/?uid=ID&pwd=密码   
查询用户余额接口
其中ID和密码可以直接使用您在本系统中的帐号信息。在本系统中,您同样可以查看到调用接口发送的扣费明细,方便对接口的管理。


再有问题,留言或发站内信问我。
ganggang4321 2009-02-03
  • 打赏
  • 举报
回复
多谢谢大家了,好像是icq已经取消在中国这方面的功能了,所以用不了了,
Zijian_Zhang 2009-02-02
  • 打赏
  • 举报
回复
看不懂,帮顶。
ganggang4321 2009-02-02
  • 打赏
  • 举报
回复
hqaht 2009-02-02
  • 打赏
  • 举报
回复
我刚才试了一下,不可以
Sms not sent

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧