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 生成饼图 三维饼图
Sep 28 PHP
基于php缓存的详解
May 15 PHP
使用PHP下载CSS文件中的图片的代码
Sep 24 PHP
解决cPanel无法安装php5.2.17
Jun 22 PHP
ThinkPHP惯例配置文件详解
Jul 14 PHP
php提高网站效率的技巧
Sep 29 PHP
遍历echsop的region表形成缓存的程序实例代码
Nov 01 PHP
thinkPHP框架对接支付宝即时到账接口回调操作示例
Nov 14 PHP
PHP获取当前URL路径的处理方法(适用于多条件筛选列表)
Feb 10 PHP
PHP魔术方法之__call与__callStatic使用方法
Jul 23 PHP
CakePHP框架Model函数定义方法示例
Aug 04 PHP
php的无刷新操作实现方法分析
Feb 28 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
PHP集成FCK的函数代码
2008/09/27 PHP
用Php编写注册后Email激活验证的实例代码
2013/03/11 PHP
使用PHPExcel实现数据批量导出为excel表格的方法(必看)
2017/06/09 PHP
弹出模态框modal的实现方法及实例
2017/09/19 PHP
JavaScript版代码高亮
2006/06/26 Javascript
javascript instanceof 内部机制探析
2010/10/15 Javascript
jquery scrollTop方法根据滚动像素显示隐藏顶部导航条
2013/05/27 Javascript
javascript闭包传参和事件的循环绑定示例探讨
2014/04/17 Javascript
JS实现在页面随时自定义背景颜色的方法
2015/02/27 Javascript
js下拉选择框与输入框联动实现添加选中值到输入框的方法
2015/08/17 Javascript
JavaScript实现图片滑动切换的代码示例分享
2016/03/06 Javascript
Bootstrap零基础入门教程(二)
2016/07/18 Javascript
Linux CentOS系统下安装node.js与express的方法
2017/04/01 Javascript
JS实现新建文件夹功能
2017/06/17 Javascript
layui使用表格渲染获取行数据的例子
2019/09/13 Javascript
Python中使用PyHook监听鼠标和键盘事件实例
2014/07/18 Python
用python实现面向对像的ASP程序实例
2014/11/10 Python
Python多线程编程(五):死锁的形成
2015/04/05 Python
PyQt5+requests实现车票查询工具
2019/01/21 Python
python基础知识(一)变量与简单数据类型详解
2019/04/17 Python
python GUI库图形界面开发之PyQt5线程类QThread详细使用方法
2020/02/26 Python
.img/.hdr格式转.nii格式的操作
2020/07/01 Python
Champion官网:美国冠军运动服装
2017/01/25 全球购物
测试时代收集的软件测试面试题
2013/09/25 面试题
JSP和Servlet有哪些相同点和不同点,他们之间的联系是什么?
2015/10/22 面试题
销售高级职员求职信
2013/10/29 职场文书
办公室文书岗位职责
2013/12/16 职场文书
银行见习期自我鉴定
2014/01/29 职场文书
中学生打架检讨书
2014/02/10 职场文书
写字楼租赁意向书
2014/07/30 职场文书
廉政文化进校园广播稿
2014/10/20 职场文书
2015年员工工作表现评语
2015/03/25 职场文书
婚前协议书怎么写,才具有法律效力呢 ?
2019/06/28 职场文书
创业计划书之零食店(进口)
2019/09/24 职场文书
python+opencv实现视频抽帧示例代码
2021/06/11 Python
JS封装cavans多种滤镜组件
2022/02/15 Javascript