管辖的企业有152家了,而且一直在增加中,太多了记不住,于是想弄个树形结构图,以网页的形式也可以共享给同事用,有时候外出开会的时候,用手机也可以查看。单位名单得保密,只限同事们查询,于是想到用php来写。在index.html中输入密码后,提交给php验证并显示,代码如下:
<?php header('Content-type: text/html; charset=gb2312'); $password = isset($_POST['password']) ? $_POST['password'] : ''; for ($x=1; $x<=100; $x++) { $password = md5($password); } switch ($password) { /* 下面是密码正确时显示的页面 */ case 'df79865af4eaa72e0cb4d80dcf0d68bf':case '071127f71761bd3d247911fec4eb7cd7': echo <<<END <!DOCTYPE html > <html xmlns=" ………… </html> END; break; /* 下面是密码错误的页面 */ default: echo "<script>location.href='https://baidu.com';</script>"; } ?>