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


Posted in PHP onOctober 09, 2006

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

PHP 相关文章推荐
怎么使 Mysql 数据同步
Oct 09 PHP
一个PHP日历程序
Dec 06 PHP
php 友好URL的实现(吐血推荐)
Oct 04 PHP
在JavaScript中调用php程序
Mar 09 PHP
php中var_export与var_dump的区别分析
Aug 21 PHP
PHP+Mysql+jQuery实现发布微博程序 jQuery篇
Oct 08 PHP
php中单个数据库字段多列显示(单字段分页、横向输出)
Jul 28 PHP
yii中widget的用法
Dec 03 PHP
php实现httpRequest的方法
Mar 13 PHP
Yii2中简单的场景使用介绍
Jun 02 PHP
IOS 开发之NSDictionary转换成JSON字符串
Aug 14 PHP
Laravel (Lumen) 解决JWT-Auth刷新token的问题
Oct 24 PHP
搜索引擎技术核心揭密
Oct 09 #PHP
输出控制类
Oct 09 #PHP
提取HTML标签
Oct 09 #PHP
如何把PHP转成EXE文件
Oct 09 #PHP
一个查看session内容的函数
Oct 09 #PHP
一个显示天气预报的程序
Oct 09 #PHP
web方式ftp
Oct 09 #PHP
You might like
php写的AES加密解密类分享
2014/06/20 PHP
Chrome Web App开发小结
2014/09/04 PHP
FastCGI 进程意外退出造成500错误
2015/07/26 PHP
PHP微信网页授权的配置文件操作分析
2019/05/29 PHP
js escape,unescape解决中文乱码问题的方法
2010/05/26 Javascript
js 字符串转化成数字的代码
2011/06/29 Javascript
JavaScript之数组(Array)详解
2015/04/01 Javascript
jQuery插件zepto.js简单实现tab切换
2015/06/16 Javascript
js实现五星评价功能
2017/03/08 Javascript
jQuery 控制文本框自动缩小字体填充
2017/06/16 jQuery
移动设备手势事件库Touch.js使用详解
2017/08/18 Javascript
vue实现2048小游戏功能思路详解
2018/05/09 Javascript
vue2.0 下拉框默认标题设置方法
2018/08/22 Javascript
使用vue完成微信公众号网页小记(推荐)
2019/04/28 Javascript
webpack结合express实现自动刷新的方法
2019/05/07 Javascript
electron+vue实现div contenteditable截图功能
2020/01/07 Javascript
利用React高阶组件实现一个面包屑导航的示例
2020/08/23 Javascript
Python 出现错误TypeError: ‘NoneType’ object is not iterable解决办法
2017/01/12 Python
Python3实现的爬虫爬取数据并存入mysql数据库操作示例
2018/06/06 Python
flask-restful使用总结
2018/12/04 Python
Python基于pygame实现单机版五子棋对战
2019/12/26 Python
什么是python的必选参数
2020/06/21 Python
python如何爬取动态网站
2020/09/09 Python
Python高并发和多线程有什么关系
2020/11/14 Python
改变生活的男士内衣:SAXX Underwear
2019/08/28 全球购物
宝信软件JAVA工程师面试经历
2012/08/19 面试题
一份创业计划书范文
2014/02/08 职场文书
计算机毕业生求职信
2014/06/10 职场文书
房屋买卖委托书格式范本格式
2014/10/13 职场文书
社区服务活动报告
2015/02/05 职场文书
小人国观后感
2015/06/11 职场文书
运动会3000米加油稿
2015/07/21 职场文书
公司保洁员管理制度
2015/08/04 职场文书
Python基础之常用库常用方法整理
2021/04/30 Python
python基于turtle绘制几何图形
2021/06/15 Python
vue二维数组循环嵌套方式 循环数组、循环嵌套数组
2022/04/24 Vue.js