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来检测proxy
Oct 09 PHP
PHP Smarty生成EXCEL文档的代码
Aug 23 PHP
php 传值赋值与引用赋值的区别
Dec 29 PHP
PHP操作文件类的函数代码(文件和文件夹创建,复制,移动和删除)
Nov 10 PHP
php Hex RGB颜色值互换的使用
May 10 PHP
php创建和删除目录函数介绍和递归删除目录函数分享
Nov 18 PHP
php使用ffmpeg向视频中添加文字字幕的实现方法
May 23 PHP
PHP  实现等比压缩图片尺寸和大小实例代码
Oct 08 PHP
PHP判断文件是否被引入的方法get_included_files用法示例
Nov 29 PHP
phpmyadmin下载、安装、配置教程
May 16 PHP
解决laravel-admin 自己新建页面里 js 需要刷新一次的问题
Oct 03 PHP
thinkphp5 框架结合plupload实现图片批量上传功能示例
Apr 04 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 中文处理函数集合
2008/08/27 PHP
Windows Apache2.2.11及Php5.2.9-1的安装与配置方法
2009/06/08 PHP
PHP中魔术变量__METHOD__与__FUNCTION__的区别
2014/09/29 PHP
PHP实现的简单缓存类
2015/07/29 PHP
使用PHPCMS搭建wap手机网站
2015/09/20 PHP
thinkPHP下ueditor的使用方法详解
2015/12/26 PHP
php版微信支付api.mch.weixin.qq.com域名解析慢原因与解决方法
2016/10/12 PHP
PHP+Ajax无刷新带进度条图片上传示例
2017/02/08 PHP
js静态方法与实例方法分析
2011/07/04 Javascript
jquery事件机制扩展插件 jquery鼠标右键事件
2011/12/21 Javascript
javascript作用域和闭包使用详解
2014/04/25 Javascript
js淡入淡出的图片轮播效果代码分享
2015/08/24 Javascript
实例详解angularjs和ajax的结合使用
2015/10/22 Javascript
关注jquery技巧提高jquery技能(前端开发必学)
2015/11/02 Javascript
jquery获取select选中值的方法分析
2015/12/22 Javascript
浅析js的模块化编写 require.js
2016/12/07 Javascript
Agularjs妙用双向数据绑定实现手风琴效果
2017/05/26 Javascript
详解vue渲染从后台获取的json数据
2017/07/06 Javascript
jQuery简单实现向列表动态添加新元素的方法示例
2017/12/25 jQuery
Vue 组件(component)教程之实现精美的日历方法示例
2018/01/08 Javascript
Vue实战教程之仿肯德基宅急送App
2019/07/19 Javascript
在Vue中使用antv的示例代码
2020/06/29 Javascript
Vue自定义全局弹窗组件操作
2020/08/11 Javascript
Python深入学习之对象的属性
2014/08/31 Python
Python读取ini文件、操作mysql、发送邮件实例
2015/01/01 Python
在Python的Flask框架下使用sqlalchemy库的简单教程
2015/04/09 Python
Python中关于Sequence切片的下标问题详解
2017/06/15 Python
10款最佳Python开发工具推荐,每一款都是神器
2020/10/15 Python
python 批量下载bilibili视频的gui程序
2020/11/20 Python
维也纳通行证:Vienna PASS
2019/07/18 全球购物
质检部岗位职责
2013/11/11 职场文书
前台文员岗位职责
2013/12/28 职场文书
解除合同协议书
2014/04/17 职场文书
庆七一宣传标语
2014/10/08 职场文书
离婚民事起诉状
2015/08/03 职场文书
2019年浪漫婚礼证婚词
2019/06/27 职场文书