2024年6月19日发(作者:)
最近很多人问我怎么平台源码问题,下
面我就出个回拨电话的教程,这个是最
简单的平台。我们用最简单的方法搭建
平台。
我们要准备搭建平台的东西。
1.空间一个,论坛的免费空间很多啊。
没有的可以去注册个。
2.准备个上传空间的工具.CuteFTP 8
Professional 可以把这名字复制到百
度下载个。
我们只要这2个就可以了。
现在我们开始
第一步,我们复制下面的源码
。
< ?php
header("Content-Type:text/html;charset=utf-8");
>
< html>
< head>
< meta name="viewport" content="width=device-width, minimum-scale=1.0,
maximum-scale=2.0"/>
< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
< title>在线免费电话
< style type="text/css">
body{
background-color: #fff;
font-size: 12px;
padding:0;
margin: auto;
}
.title{
border-bottom: 1px solid blue;
background-color: 333;
color: #fff;
height: 20px;
line-height: 20px;
padding-left: 5px;
}
.footer{
background-color: #ddd;
text-align: center;
color: #3D464E;
padding-top: 20px;
padding-bottom: 10px;
border-bottom: 1px solid #123;
border-top: 1px solid #eee;
}
.copyright{
background-color: #ddd;
text-align: right;
color: #326545;
}
.content{
padding-left: 5px;
padding-top: 2px;
}
.red{
height: 20px;
line-height: 20px;
background-color: red;
color: #fff;
padding-left: 5px;
}
.green{
height: 20px;
line-height: 20px;
background-color: green;
color: #fff;
padding-left: 5px;
}
.button{
border-top:0;
border-left:0;
border-bottom: 1px solid #000;
border-right: 1px solid #000;
padding: 2px 5px 2px 5px;
cursor: pointer;
}
.button:hover{
background-color: #ddd;
}
.button:active{
background-color: #999;
border-top:1px solid #fff;
border-left:1px solid #fff;
border-bottom: 0px solid #ddd;
border-right: 0px solid #ddd;
}
< /style>
< /head>
< body>
$act = isset($_GET['act'])?$_GET['act']:null;
if($act=='call'){
$calls =
(isset($_POST['callphone'])&&is_numeric($_POST['callphone']))?$_POST['callphone
']:null;
$mys =
(isset($_POST['myphone'])&&is_numeric($_POST['myphone']))?$_POST['myphone']:nul
l;
if($calls && $mys){
if(function_exists('socket_create')){
$result = json_decode(call($calls,$mys));
}elseif(function_exists('fsockopen')){
$result = json_decode(call2($calls,$mys));
}else{
$result = json_decode(call3($calls,$mys));
}
if($result->status){
echo '
'.$result->msg.'
';
}else{
echo '
'.$result->msg.'
';
}
}else{
if($calls==""){
$msg="请填写主叫号码!";
}elseif($mys==""){
$msg="请填被叫号码!";
}
echo '
'.$msg.'
';
}
}
>
< div class="title">在线免费电话
< div class="content">
< form action="?act=call" method="post">
主叫:
被叫:
< /form>
电话论坛
< /div>
< div class="footer">
月夕论坛@2012
QQ:823632013
< /div>
< div class="copyright">by
< /body>
< /html>
< ?php
function call($callphone,$myphone){
$call_api =
"/jzt/?p1={$callphone}&p2={$myphone}&p9=%E5
%91%BC%E5%8F%AB";
$commonProtocol = @getprotobyname("tcp");
$socket = @socket_create(AF_INET, SOCK_STREAM, $commonProtocol);
$info = parse_url($call_api);
@socket_connect($socket, $info['host'],isset($info['port'])?$info['port']:80);
$buffer = buildRequest($call_api,$info);
@socket_write($socket, $buffer);
$recv = @socket_read($socket, 4096);
$body = "";
if(strpos($recv, "rnrn")){
$header = explode("rnrn", $recv);
for($i=1;$i==1;$i++){
$body.=$header[$i];
}
}else{
$body='{"status":false,"msg":"u547cu53ebu5931u8d25"}';
}
@socket_close($socket);
return $body;
}
function call2($callphone,$myphone){
$call_api
="/jzt/?p1={$callphone}&p2={$myphone}&p9=%E
5%91%BC%E5%8F%AB";
$info = parse_url($call_api);
if (!($fp = @fsockopen($info['host'],isset($info['port'])?$info['port']:80,
$errno, $errstr,30))) {
// Set error message
switch($errno) {
case -3:
$errormsg = 'Socket 创建失败(-3)';
case -4:
$errormsg = 'DNS查找故障 (-4)';
case -5:
$errormsg = '连接被拒绝或超时 (-5)';
default:
$errormsg = '连接失败 ('.$errno.')';
$errormsg .= ' '.$errstr;
}
return '{"status":false,"msg":"u547cu53ebu5931u8d25"}';
}
socket_set_timeout($fp,60);
$buffer = buildRequest($call_api,$info);
fwrite($fp, $buffer);
$body = "";
$header=null;
$atStart = true;
while (!feof($fp)) {
$recv = fgets($fp, 4096);
if ($atStart) {
// Deal with first line of returned data
$atStart = false;
if (!preg_match('/HTTP(d.d)s*(d+)s*(.*)/', $recv, $m)) {
continue;
}
continue;
}
if(!$header){
if (trim($recv) == ''){
$header = true;
continue;
}
continue;
}
$body.=$recv;
}
fclose($fp);
return $body;
}
function call3($callphone,$myphone){
$call_api =
"/jzt/?p1={$callphone}&p2={$myphone}&p9=%E5
%91%BC%E5%8F%AB";
return file_get_contents($call_api);
}
function buildRequest($call_api,$info){
$ip = GetIP();
$ua = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.11 (KHTML, like Gecko)
Chrome/20.0.1132.57 Safari/536.11";
if(isset($_SERVER['HTTP_USER_AGENT'])){
$ua = $_SERVER['HTTP_USER_AGENT'];
}
$buffer = "GET $call_api HTTP/1.0rn";
$buffer.= "Connection:keep-alivern";
$buffer.=
"Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8rn";
$buffer.= "Host:{$info['host']}rn";
$buffer.= "Prox-Host:{$_SERVER['HTTP_HOST']}{$_SERVER['SCRIPT_NAME']}rn";
$buffer.= "User-Agent:{$ua}rn";
if($ip!="127.0.0.1" || $ip!="Unknown"){
$buffer.= "Client-Ip: {$ip}rn";
$buffer.= "X-FORWARDED-FOR: {$ip}rn";
}
$buffer.= "rn";
return $buffer;
}
function GetIP() {
if ($_SERVER["HTTP_X_FORWARDED_FOR"])
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
else if ($_SERVER["HTTP_CLIENT_IP"])
$ip = $_SERVER["HTTP_CLIENT_IP"];
else if ($_SERVER["REMOTE_ADDR"])
$ip = $_SERVER["REMOTE_ADDR"];
免费回拨电话.为大家整理。文章来自月夕。谢谢观看
else if (getenv("HTTP_X_FORWARDED_FOR"))
$ip = getenv("HTTP_X_FORWARDED_FOR");
else if (getenv("HTTP_CLIENT_IP"))
$ip = getenv("HTTP_CLIENT_IP");
else if (getenv("REMOTE_ADDR"))
$ip = getenv("REMOTE_ADDR");
else
$ip = "Unknown";
return $ip;
}
第2步.我们新建个TXT文档
打开文档,把上面的代码粘贴进去。
第3步我们修改上面的链接,你可以抓
包得到一个回拨电话的GET链接啊,我
现在代码上链接是我的一个平台。你们
有别的资源可以换下别的链接啊,记住,
php结尾要加上小的问号 “?”.
改3个链接:如图:
免费回拨电话.为大家整理。文章来自月夕。谢谢观看
第2个链接
第3个链接
/jzt/?p1={$callphone}&p2=
只要换这个链接就行了,别的都不要动。
第四步,修改好了,我们来保存文档。
在修改TXT文档的名字。
改成.如图:
{$myphone}&p9=%E5%91%BC%E5%8F%AB
第五步我们上传空间,就可以了。
本文标签:
拨电话链接免费空间平台
发表评论