首页 > WEB互联网 > APP登陆认证API接口(适用于博主的控流)APP后云端配置路线联系博主
2016
06-24

APP登陆认证API接口(适用于博主的控流)APP后云端配置路线联系博主

oyblog_api.php

<?php
header(“Content-Type: text/html;charset=utf-8″);
$host=””;
$usern=””;
$passwd=””;
$db=””;
mysql_connect($host,$usern,$passwd) or EXIT(“mysql=no”);
mysql_select_db($db);
if(addslashes($_GET[‘user’])!=””){

$uname=trim(addslashes($_GET[‘user’]));
ECHO(oyblog($uname));
}
function oyblog($uname){

$uname=trim($uname);
IF($uname==””){

return “密码错误”;

}
$pwd=addslashes($_GET[‘pass’]);
mysql_fetch_array(mysql_query(“INSERT INTO stat (username) VALUES (‘$uname’) ON DUPLICATE KEY UPDATE username=username”));
mysql_fetch_array(mysql_query(“UPDATE stat SET origin_time=now() where origin_time=’0000-00-00 00:00:00′ and username=’$uname'”));
mysql_fetch_array(mysql_query(“UPDATE user SET creation=(select origin_time from stat where stat.username=’$uname’) WHERE username=’$uname'”));
$SQL=”SELECT * FROM user WHERE username LIKE ‘$uname’ LIMIT 0 , 30″;
$oyblog=mysql_query($SQL);
$res=mysql_fetch_array($oyblog);
if($res[‘password’]!=$pwd){
echo ‘密码错误’;
}else
{
IF($res[‘username’]==$uname){
$res[‘fasong’]=$res[‘fasong’]/1024/1024;
$res[‘jieshou’]=$res[‘jieshou’]/1024/1024;
$res[‘quota_bytes’]=floor($res[‘quota_bytes’]/1024/1024);
$res[‘fasong’]=floor($res[‘fasong’]);
$res[‘jieshou’]=floor($res[‘jieshou’]);
$res[‘quota_bytes’]=floor($res[‘quota_bytes’]);
$res[‘left_quota’]=floor($res[‘left_quota’]/1024/1024);
$res[‘left_quota’]=floor($res[‘left_quota’]);
$shengyu=ceil($res[‘surplus_cycle’]);
$time=$res[‘quota_cycle’];
$Activationtime=$res[‘creation’];
$Expirationtime=date(‘Y-m-d’,strtotime($Activationtime . ‘+’.$time.’ day’));
$BC=”<p>账号:”.$res[‘username’].”</p><p>发送:”.$res[‘fasong’].”MB</p><p>接收:”.$res[‘jieshou’].”MB</p><p>总量:”.$res[‘quota_bytes’].”MB</p><p>剩余:”.$res[‘left_quota’].”MB</p><p>注册时间:”.$Activationtime.”</p><p>到期时间:”.$Expirationtime.”</p><p>剩余天数:”.$shengyu.
” 天
“;
return ;

}return “密码错误”;

}
}
?>

最后编辑:
作者:欧阳
欧阳
设计界的一只猿|平面设计|创意|WEB安全|互联网

留下一个回复

你的email不会被公开。