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

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

时间: 2024-08-02 09:49:17

php使用ICQ网关发送手机短信_php实例的相关文章

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

程序 通过ICQ网关发送手机短信的PHP源程序(转自linuxforum.net 原作者:liushiliang EMAIL:  lsl@163.net ) <?//###########################################################//// For questions and comments// Roland (alias -=: Vlieg :=-)// icq #78354631// mail: vlieg@atoomnet.net///

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

通过ICQ网关发送手机短信的PHP源程序(转自linuxforum.net 原作者:liushiliang EMAIL:  lsl@163.net ) <?//###########################################################//// For questions and comments// Roland (alias -=: Vlieg :=-)// icq #78354631// mail: vlieg@atoomnet.net//// N

利用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 secu

利用java实现的一个发送手机短信的小例子

今天闲来无事,在微博上看到一个关于用java实现的一个发送手机短信的程序,看了看,写的不太相信,闲的没事,把他整理下来,以后可能用得着 JAVA发送手机短信,流传有几种方法:(1)使用webservice接口发送手机短信,这个可以使用sina提供的webservice进行发送,但是需要进行注册;(2)使用短信mao的方式进行短信的发送,这种方式应该是比较的常用,前提是需要购买硬件设备,呵呵(3)使用中国网建提供的SMS短信平台(申请账号地址:http://sms.webchinese.cn/de

java实现发送手机短信_java

本文主要研究了JAVA语言发送手机,分享给大家,供大家参考,具体内容如下 JAVA发送手机短信,流传有几种方法: (1)使用webservice接口发送手机短信,这个可以使用sina提供的webservice进行发送,但是需要进行注册; (2)使用短信mao的方式进行短信的发送,这种方式应该是比较的常用,前提是需要购买硬件设备,呵呵; (3)使用中国网建提供的SMS短信平台,我的这个小的demo,是基于这个行是发送的.  说明:java实现发送手机短信 /** * 说明:java实现发送手机短信

使用PHP免费发送定时短信的实例_php实例

由于飞信目前没有开发平台,现有API都是第三方开发,貌似是通过破解WAP飞信或者3G飞信,模拟浏览器的行为来发短信.另外Google code上有开源的php飞信发送类php-fetion.这些飞信接口方便了定时短信的开发. 背景:老妈年纪大了,文化程度不高,但是需要每天了解天气信息才能下地工作,也就无法通过网络获取天气,只能通过电视.于是寻思着自己抓取网络上的天气信息,通过手机短信发送给老妈. 问题:自己不可能每天定时给老妈发送天气短信,现有的天气预报订阅短信又是要钱的. 解决: 免费发送短信

VB/vb.net 浙江移动发送手机短信实例!

'Form1 窗体Dim userID As StringDim mobileNo As StringDim checkRnd As StringDim longin As BooleanDim checkRndBox As StringPublic fileno As VariantDim ys As IntegerDim su As LongDim sum As LongDim pas As String Private Sub Check2_Click()On Error GoTo err

php结合飞信 免费天气预报短信_php实例

开始教你怎么弄 一.需要有一个PHP环境.为了图省事下载APMServ软件快速搭建PHP环境 二.下载天气预报短信通知PHP程序点这里下载代码 三.修改PHP程序配置 用记事本打开WeatherForecast.php文件 复制代码 代码如下: <? /** * 飞信通知天气预报 * 2009-4-23 */ //禁止执行时间限制 set_time_limit (0); //设置MB编码 mb_internal_encoding("GB2312"); /** * 采集新浪天气预报

限制一分钟只能发送一次手机短信

为什么要限制一分钟之内只能发送一次手机短信呢? 防止恶意攻击. 什么场景需要发送手机短信? (a)手机号注册 (b)通过手机找回密码 (c)手机号绑定,手机号换绑 (d)转账时手机号接收动态口令(一次一密)   1,前端 一般前端会有倒计时,在倒计时的过程中是不允许点击"发送短信"按钮的: 但是如果用户刷新页面呢? 如果刷新页面,那么页面的倒计时就会中断.  这是需要服务器端提供支持:服务器端要记录上次发送短信的时间戳   2,后台 第一次发送时lastSendSMSTime 为nul