<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>小绿叶通讯录</title>
<style>
*{margin:0;padding:0;color:#444}
body{font-size:14px;font-family:"宋体"}
.main{width:600px;margin:10% auto;}
.title{background: #20a53a;color: #fff;font-size: 16px;height: 40px;line-height: 40px;padding-left: 20px;}
.content{background-color:#f3f7f9; height:500px;border:1px dashed #c6d9b6;padding:20px}
.t1{border-bottom: 1px dashed #c6d9b6;color: #ff4000;font-weight: bold; margin: 0 0 20px; padding-bottom: 18px;}
.t2{margin-bottom:8px; font-weight:bold}
ol{margin:0 0 20px 22px;padding:0;}
ol li{line-height:30px}
</style>
</head>
<body>
<div class="main">
<div class="title">小绿叶技术博客通讯录站点</div>
<div class="content">
<p class="t1">ic.eisc.cn</p>
<p class="t2">提示:</p>
<ol>
<li>Hello, Please enter your colleague's nickname to inquire the address book information!</li>
<br />
</ol>
<form action="http://ic.eisc.cn" method="post">
<input name="inputname" type="text" placeholder="请输入姓名" required/>
<input name="inputWh" type="text" placeholder="请输入外号" required/>
<textarea placeholder="留下您的名字"></textarea>
<input name="提交" type="submit" value="提交数据库查询"action=""/>
</form>
<?php
// ------------- 时间函数 ----------------------
function get_time($server){
date_default_timezone_set('Asia/Shanghai');//解决差8小时问题
$data = "HEAD / HTTP/1.1\r\n";
$data .= "Host: $server\r\n";
$data .= "Connection: Close\r\n\r\n";
$fp = fsockopen($server, 80);
fputs($fp, $data);
$resp = '';
while ($fp && !feof($fp))
$resp .= fread($fp, 1024);
preg_match('/^Date: (.*)$/mi',$resp,$matches);
return strtotime($matches[1]);
}
echo date('Y-m-d H:i:s',get_time("www.tudou.com"));
echo "<br /><br />";
// -------------------------------------------------
echo "<table style='border: solid 1px black;'>";
echo "<tr><th>Id</th><th>姓名</th><th>外号</th><th>电话</th></tr>";
class TableRows extends RecursiveIteratorIterator {
function __construct($it) {
parent::__construct($it, self::LEAVES_ONLY);
}
function current() {
return "<td style='width:150px;border:1px solid black;'>" . parent::current(). "</td>";
}
function beginChildren() {
echo "<tr>";
}
function endChildren() {
echo "</tr>" . "\n";
}
}
$servername = "127.0.0.1";
$username = "rrrr";
$password = "fffff";
$dbname = "fffff";
$cwh=$_REQUEST['inputWh'];
$cname=$_REQUEST['inputname'];
echo "输入正确1个,即可查询;您输入的信息为:$cwh $cname";
// $_REQUEST[] 获取输入框名字的值
//用于页面输入的参数,查询数据库
try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("SELECT id, name, wh, ted FROM eisc
where name='$cname'
or wh='$cwh'");
$stmt->execute();
// 设置结果集为关联数组
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) as $k=>$v) {
echo $v;
}
}
catch(PDOException $e) {
echo "Error: " . $e->getMessage();
}
$conn = null;
echo "</table>";
?>
<br /><br /><br />
<p class="t2">为您展示以下分机:</p>
<ol>
<li><a href="http://www.eisc.cn">www.eisc.cn</a></li>
<li><a href="http://work.eisc.cn">work.eisc.cn</a></li>
<li><a href="http://work.eisc.cn/ruanjian">软件</a></li>
<li><a href="http://sou.eisc.cn">sou.eisc.cn</a></li>
</ol>
</div>
</div>
</body>
</html>
Powered by ddoss.cn 12.0
©2015 - 2025 ddoss
渝公网安备50011302222260号
渝ICP备2024035333号
【实验平台安全承诺书】
小绿叶技术社区,优化网络中,点击查看配置信息
主机监控系统: 安全防火墙已开启检查cc攻击-下载文件完成后等待10s 恢复访问,检查连接数低于峰值恢复访问
您的IP:216.73.216.110,2025-12-01 16:11:00,Processed in 0.01482 second(s).