<?php
$flag=0;
//var_dump($_GET);
if(isset($_GET["out"])){
if($_GET["out"]){
// setcookie('uname','',time()-1);
$flag=1;//防止服务器接收到getout操作时已经认为该用户有cookie,然后下面的COOKIE
}
}
if($flag!=1){
$con=mysqli_connect('127.0.0.1','root','123456','vultureData');
if (!$con)
{
// die('Could not connect: ' . mysql_error());
echo "connect fail?<br>";
}
/*if(isset($_COOKIE['uname'])){
$name=$_COOKIE['uname'];
echo "Welcome ".$_COOKIE['uname']."";*/
echo "Welcome ";
$result = mysql_query($con,"select * from facerecord");
echo "<table border='1'>
<tr>
<th>faceName</th>
<th>certificatesID</th>
<th>status</th>
<th>statustime</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['faceName'] . "</td>";
echo "<td>" . $row['certificatesID'] . "</td>";
echo "<td>" . $row['status'] . "</td>";
echo "<td>" . $row['statustime'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
echo '<a href="index.php?out=1">logout</a>';
}else{
echo '<a href="login.html">login</a>';
echo ' ';
}
}
else{
echo '<a href="login.html">login</a>';
echo ' ';
}?>