<?php
/*
查分吧PHP两条件都输对版通用查询系统 V1.0
禁止用于非法目的,使用说明书见readme.chalide.html
代码更新:https://gitee.com/weivote/chafenba
代码演示:http://96448.cn/chafenba/
*/
//error_reporting(0); //打开报错:行首去双斜杠
$webtitle = "查分吧PHP两条件都输对版通用查询系统"; //网站标题
$filedata = "data.csv.php"; //数据相对路径,注意:伪静态防止文件夹或文件下载处理。
$tj1 = "姓名"; //修改查询条件1
$tj2 = "学号"; //修改查询条件2
$ads ="请保留以下信息前提下: 系统免费使用(不显示在WEB前端):
查分吧PHP两条件都输对版通用查询系统 V1.0
作者信息:15058593138@qq.com <仅供错误反馈,不提供技术支持>
以下域名出售中:soulide.cn 搜立得:各种搜索应用。
详情: https://135634.shop.ename.com/
";//请保留以上信息前提下: 系统免费使用(不显示在WEB前端):
if($_GET["x"]=="cha"){
$tid = (isset($_POST['tid']))?Trim($_POST['tid']):"";
$xid = (isset($_POST['xid']))?Trim($_POST['xid']):"";
if($xid=="" || $tid=="") exit("<p>请输入{$tj1}+{$tj2}</p>");
if(!file_exists($filedata)) exit("<p>检查数据文件是否存在!</p>");
$file = fopen($filedata,"r");
$headers = null; $list=array(); $lin=""; $ii=0;
while(! feof($file)) {
$data = fgetcsv($file,0,"\t");
if (is_array($data)) {
if (!$headers && in_array($tj1,$data) && in_array($tj2,$data)) {
$headers=$data; $lin=count($headers);
$tii=array_search($tj1,$headers); $tjj=array_search($tj2,$headers);
}else if($data[$tii]==$xid && $data[$tjj]==$tid){
$tb .= "\r\n<table>"; $ii++;
foreach($data as $key=>$value){
$tb .= "\r\n<tr><td class='r'>{$headers[$key]}</td><td>$value</td></tr>\r\n";
}
$tb .= "</table>\r\n\r\n";
}else{
}
}
}
fclose($file);
if(!$headers) exit("<p>请检查:查询条件是否都正确设置</p>!");
if($ii<1) exit("<p>请检查输入:没有查询到相关信息。</p>");
echo $tb;
exit();
}
?><!DOCTYPE html><html><head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $webtitle;?></title>
<style>
*{margin:0;font-size:16px;}
body{font-family:Arial,sans-serif;background-color:#f2f2f2;}
.container{width:60%;margin:50px auto;padding:20px;background-color:#fff;border-radius:5px;box-shadow:0 0 10px rgba(0,0,0,0.3);max-width:600px;min-width:300px;}
result{margin:0px auto;padding-top:30px;}
h1{margin:10px auto;font-size:20px;text-align:center;}
p{margin-bottom:20px;text-align:left;}
input{display:block;position:relative;background:none;border:2px solid #acacac;border-radius:5px;width:calc(99% - 20px);padding:0 10px;height:35px;z-index:1;}
label{display:inline-block;position:relative;top:-32px;left:10px;color:#acacac;z-index:2;transition:all 0.2s ease-out;}
input:focus,input:valid{outline:none;border:2px solid #4CAF50;}
input:focus + label,input:valid + label{top:-50px;color:#4CAF50;background-color:#fff;}
button{display:inline;padding:8px 15px;background-color:#4CAF50;color:#fff;border:none;border-radius:5px;cursor:pointer;}
button:hover{background-color:#3e8e41;}
table {border-top:3px solid #4CAF50;width:99.9%; margin:10px auto;}
.r{font-weight:bold;text-align:center;}
table tr:nth-child(2n){background:#FAFAFA;}
</style>
<script>
function $(objId){
return document.getElementById(objId);
}
function loadcha(ttt) {
var xmlhttp;
$("result").innerHTML = "正在加载...";
if(ttt=="xxx"){
$("result").innerHTML = "<p>输入参考:姓名:张三;学号:100000001</p>"; return false;
}
if($("xid").value=="" || $("tid").value==""){
$("result").innerHTML = "<p>以上各项都得输入!</p>"; return false;
}
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
$("result").innerHTML = xmlhttp.response;
}
}
xmlhttp.open("POST", "?x=" + ttt +"&t="+Math.random(), true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send("xid=" + $("xid").value + "&tid=" + $("tid").value);
}
</script>
</head>
<body>
<div class="container">
<h1><?php echo $webtitle;?></h1>
<input type="text" name="xid" id="xid" required>
<label for="xid"><?php echo $tj1;?></label>
<input type="text" name="tid" id="tid" required>
<label for="tid"><?php echo $tj2;?></label>
<p><button onclick="loadcha('cha');">查询</button>
<button onclick="loadcha('xxx');">帮助</button></p>
<div id="result"></div>
</div>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![thumb](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![exe](https://img-home.csdnimg.cn/images/20210720083343.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 4 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/cb3ef9cd632345779e6826b47461fb9e_qq_27489007.jpg!1)
芝麻粒儿
- 粉丝: 6w+
- 资源: 2万+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)