<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<h3>注册</h3>
<form action="zcchuli.php" method="post">
<div>用户名<input type="text" name="uid" /></div>
<div>密码<input type="text" name="pwd" /></div>
<div>姓名<input type="text" name="name" /></div>
<div>性别<input type="text" name="sex" /></div>
<div>生日<input type="text" name="birthday" /></div>
<div><input type="submit" value="注册"/></div>
</form>
</body>
</html>
<?php $uid=$_POST["uid"]; $pwd=$_POST["pwd"]; $name=$_POST["name"]; $sex=$_POST["sex"]; $birthday=$_POST["birthday"]; $sex=$sex=="男"?true:false; include("../DBDA.class.php"); $db=new DBDA(); $sql="insert into users values('{$uid}','{$pwd}','{$name}','{$sex}','{$birthday}',false)"; if($db->Query($sql,0)) { header("location:denglu.php"); }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <h3>登陆</h3> <form action="dlchuli.php" method="post"> <div>用户名<input type="text" name="uid" /></div> <div>密码<input type="text" name="pwd" /></div> <div><input type="submit" value="登陆"/></div> </form> </body> </html> <?php session_start(); $uid=$_POST["uid"]; $pwd=$_POST["pwd"]; include("../DBDA.class.php"); $db=new DBDA(); $sql="select count(*) from users where uid='{$uid}' and pwd='{$pwd}' and isok=true"; $r=$db->StrQuery($sql); if($r==1) { $_SESSION["uid"]=$uid; header("location:zhuye.php"); } else{ header("location:denglu.php"); }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <h3>审核</h3> <table width="100%" border="1" cellpadding="0" cellspacing="0"> <tr> <td>姓名</td> <td>性别</td> <td>生日</td> <td>状态</td> </tr> <?php include("../DBDA.class.php"); $db=new DBDA(); $sql="select * from users"; $attr=$db->Query($sql); foreach($attr as $v) { $zt=""; if($v[5]) { $zt="<span>已通过</span><a href='chexiao.php?uid=$v[0]'>撤销</a>"; } else{ $zt="<a href='shenhe.php?uid=$v[0]'>审核</a>"; } echo"<tr> <td>{$v[2]}</td> <td>{$v[3]}</td> <td>{$v[4]}</td> <td>{$zt}</td> </tr>"; } ?> </table> </body> </html>
<?php $uid=$_GET["uid"]; include("../DBDA.class.php"); $db = new DBDA(); $sql="update users set isok=true where uid='{$uid}'"; if($db->Query($sql,0)) { header("location:zhuye.php"); } else{ echo"审核失败!"; } ?>
<?php $uid=$_GET["uid"]; include("../DBDA.class.php"); $db = new DBDA(); $sql="update users set isok=false where uid='{$uid}'"; if($db->Query($sql,0)) { header("location:zhuye.php"); } else{ echo"撤销失败!"; } ?>