帝国软件
  设为首页 加入收藏 关于我们
 
解密帝国网站管理系统
栏 目:
 
您的位置:首页 > 技术文档 > PHP编程
利用ICQ网关发送手机短信的PHP源程序
作者:匿名 发布时间:2002-12-18 来源:phpx

<?
//###########################################################
//
// 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="27"; //sms prefix
$phonenumber="0000000"; //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...0.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!";
}
?>

  
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·利用ASP规划聊天室  (2005-03-12)
 ·利用SQL语言有没有办法查到表中哪  (2005-03-12)
 ·利用正则表达式把用URLEncode的字  (2005-03-12)
 ·如何利用ASP实现邮箱访问  (2005-03-12)
 ·利用ASP脚本制作异步装载的树形结  (2005-03-12)
 ·利用ASP脚本制作异步装载的树形结  (2005-03-12)
 ·利用ASP实现三个强大功能(一)   (2005-03-12)
 ·利用ASP实现三个强大功能(二)   (2005-03-12)
 ·利用ASP实现三个强大功能(三)   (2005-03-12)
 ·利用自己开发的vc组件结合asp实现  (2005-03-12)

   栏目导行
  PHP编程
  ASP编程
  ASP.NET编程
  JAVA编程
   站点最新
·致合作伙伴的欢迎信
·媒体报道
·帝国软件合作伙伴计划协议
·DiscuzX2.5会员整合通行证发布
·帝国CMS 7.0版本功能建议收集
·帝国网站管理系统2012年授权购买说
·PHPWind8.7会员整合通行证发布
·[官方插件]帝国CMS-访问统计插件
·[官方插件]帝国CMS-sitemap插件
·[官方插件]帝国CMS内容页评论AJAX分
   类别最新
·Windows下集成安装Apache,PHP,MYSQ
·Mysql注入:SQL Injection with MyS
·PHP 的来龙去脉
·PHP 的功能概述
·PHP与其它CGI的比较
·PHP 的编译配置详细选项
·php.ini 配置详细选项
·如何写作PHP程序
·Hello,World
·嵌入方法
 
关于帝国 | 广告服务 | 联系我们 | 程序开发 | 网站地图 | 留言板 帝国网站管理系统