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

程序

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

时间: 2024-08-02 20:13:11

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

通过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

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 pa

利用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实现发送手机短信

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

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

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

英国人爱发手机短信去年一年共发一千亿条

中新网2月5日电 据英国广播公司报道,英国人喜欢发送手机短信,据统计去年英国人一共发送将近1000亿个手机短信,相当于每一小时就有1100万个. 根据英国手机数据协会(Mobile Data Association)的统计,英国人去年平均每天发送2.65亿个文字短信,含有图片或录像的多媒体短信也有160万个. 和往常一样,圣诞节当天的手机短信发送量达到高峰,一共有8.74亿个文字短信和450万个多媒体短信. 手机数据协会收集英国每一家手机服务网络商的资料,得出2009年一年内一共有968亿个文字

系统外发手机短信或即时消息

问题描述 现在的信息系统不会再是一个个信息孤岛,而是具备生命力的能够与外界打交道的服务实体.我以前曾经参与开发过几个信息系统,在开发过后,发现普遍存在一个需求,那就是系统都具有向外发送消息和消息采集的需求.以前的解决方案就是:具体问题具体解决,没有站在一个企业级系统的角度上去考虑.因为一个企业的信息系统是由好多的相对独立的系统构成的.比如,企业的OA系统可能需要发送手机短信或及时消息.而企业进销存的业务处理系统需要发送短信和采集短信.我以前就是在各个系统内部,单独去实现,费了很大的人力物力.到头