php使用ICQ网关发送手机短信


Posted in PHP onOctober 30, 2013

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

<?
//###########################################################
//
// 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 相关文章推荐
PHP+DBM的同学录程序(1)
Oct 09 PHP
PHP执行速率优化技巧小结
Mar 15 PHP
php 特殊字符处理函数
Sep 05 PHP
PHP include任意文件或URL介绍
Apr 29 PHP
php5.2以下版本无json_decode函数的解决方法
May 25 PHP
PHP中new static()与new self()的区别异同分析
Aug 22 PHP
php操作csv文件代码实例汇总
Sep 22 PHP
两种php给图片加水印的实现代码
Apr 18 PHP
详解WordPress开发中的get_post与get_posts函数使用
Jan 04 PHP
Zend Framework实现多文件上传功能实例
Mar 21 PHP
PHP的Yii框架中创建视图和渲染视图的方法详解
Mar 29 PHP
php使用curl_init()和curl_multi_init()多线程的速度比较详解
Aug 15 PHP
PHP分页详细讲解(有实例)
Oct 30 #PHP
php预定义变量使用帮助(带实例)
Oct 30 #PHP
调整PHP的性能
Oct 30 #PHP
PHP数据过滤的方法
Oct 30 #PHP
php另类上传图片的方法(PHP用Socket上传图片)
Oct 30 #PHP
使用Curl进行抓取远程内容时url中文编码问题示例探讨
Oct 29 #PHP
is_uploaded_file函数引发的不能上传文件问题
Oct 29 #PHP
You might like
MVC模式的PHP实现
2006/10/09 PHP
php为字符串前后添加指定数量字符的方法
2015/05/04 PHP
php+js实现百度地图多点标注的方法
2016/11/30 PHP
laravel框架邮箱认证实现方法详解
2019/11/22 PHP
php获取是星期几的的一些常用姿势
2019/12/15 PHP
CL vs ForZe BO5 第二场 2.13
2021/03/10 DOTA
对象的类型:本地对象(1)
2006/12/29 Javascript
ext form 表单提交数据的方法小结
2008/08/08 Javascript
改变javascript函数内部this指针指向的三种方法
2010/04/23 Javascript
JS trim去空格的最佳实践
2011/10/30 Javascript
js鼠标点击事件在各个浏览器中的写法及Event对象属性介绍
2013/01/24 Javascript
JSON.parse()和JSON.stringify()使用介绍
2014/06/20 Javascript
node.js中的http.response.writeHead方法使用说明
2014/12/14 Javascript
javascript实现当前页导航激活的方法
2015/02/27 Javascript
举例讲解jQuery中可见性过滤选择器的使用
2016/04/18 Javascript
JQuery DIV 动态隐藏和显示的方法
2016/06/23 Javascript
vue-music关于Player播放器组件详解
2017/11/28 Javascript
微信小程序的mpvue框架快速上手指南
2019/05/15 Javascript
Vue+Bootstrap收藏(点赞)功能逻辑与具体实现
2020/10/22 Javascript
[11:27]《一刀刀一天》之DOTA全时刻20:TI4总奖金突破920W TS赛事分析
2014/06/18 DOTA
[54:15]DOTA2-DPC中国联赛 正赛 DLG vs Dragon BO3 第二场2月1日
2021/03/11 DOTA
python字典get()方法用法分析
2015/04/17 Python
深入解析Python的Tornado框架中内置的模板引擎
2016/07/11 Python
Python正则简单实例分析
2017/03/21 Python
python实现逆序输出一个数字的示例讲解
2018/06/25 Python
Mac安装python3的方法步骤
2019/08/09 Python
Python3 集合set入门基础
2020/02/10 Python
用Python在Excel里画出蒙娜丽莎的方法示例
2020/04/28 Python
Ray-Ban雷朋美国官网:全球领先的太阳眼镜品牌
2016/07/20 全球购物
大学生的网络创业计划书
2013/12/26 职场文书
《在山的那边》教学反思
2014/02/23 职场文书
大学共青团员个人自我评价
2014/04/16 职场文书
伦敦奥运会的口号
2014/06/21 职场文书
纪检干部现实表现材料
2014/08/21 职场文书
新闻简讯格式及范文
2015/07/22 职场文书
详解CSS不定宽溢出文本适配滚动
2021/05/24 HTML / CSS