0 Star 0 Fork 0

水痕/qilin_baoleiji

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
get_rad.php 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
手机用户3933112850 提交于 2016-04-26 19:45 . 创建
#!/usr/bin/php
<?php
function get_ran_radkey($username)
{
$conn = mysql_connect("localhost", "root", "");
if(!$conn)
{
echo "Unable to connect to DB: " . mysql_error();
}
if (!mysql_select_db("testr"))
{
echo "Unable to select testr".mysql_error();
}
$sql = "select pc_index from radkey where id = (select pc_id from device where username='".$username."');";
$result = mysql_query($sql);
if(!$result)
{
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
if(mysql_num_rows($result) == 0)
{
echo "$username not in DB\n";
exit;
}
$pc_index;
while ($row = mysql_fetch_assoc($result)) {
$pc_index = $row["pc_index"];
}
mysql_free_result($result);
$time = date("YmdHi");
$sec = date("s");
if($sec<20)
{
$sec = "00";
}
else if($sec < 40)
{
$sec = "20";
}
else
{
$sec = "40";
}
$time = $time.$sec;
/*
print $time."\n";
print $pc_index."\n";
print substr($pc_index,0,-4)."\n";
print substr($pc_index,0,-4).$time."\n";
*/
$pc_index_utf16 = substr(mb_convert_encoding(substr($pc_index,0,-4),"UTF-16","ASCII"),1);
$time_utf16 = substr(mb_convert_encoding($time,"UTF-16","ASCII"),1);
$pc_index_utf16.="\0";
$time_utf16.="\0";
# print $pc_index_utf16."\n";
# print $time_utf16."\n";
return substr(strtolower(md5($pc_index_utf16.$time_utf16)),0,6);
}
print get_ran_radkey("qi")."\n";
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yjiiyygy/qilin_baoleiji.git
git@gitee.com:yjiiyygy/qilin_baoleiji.git
yjiiyygy
qilin_baoleiji
qilin_baoleiji
master

搜索帮助