PHP+DBM的同学录程序(2)

2016-01-29 14:28 3 1 收藏

PHP+DBM的同学录程序(2),PHP+DBM的同学录程序(2)

【 tulaoshi.com - PHP 】

  3、删除成员del.php3
<?
require("common.php3");
$id=chop($id);
if(!isset($id))error("请输入要删除的用户ID !");
elseif($pwd<$adminpass)error("管理员密码错误!");
else{
  $data=dbmopen("class","w");
  dbmdelete($data,$id);
  dbmclose($data);
  $data=dbmopen("password","w");
  dbmdelete($data,$id);
  dbmclose($data);
  header("location:index.php3");
}
?

4、公用文件common.php3
<?
$adminpass="test";
function error($msg){
?
<html<head<meta http-equiv="Content-Type" content="text/html; charset=gb2312"
<link rel="stylesheet" href="style.css"<title同学录 出错</title</head<body bgcolor="#ffffff"
<html<head</head<body bgcolor="#FFFFFF"<center<table border="0" width="80%" height="80%" cellspacing="0" cellpadding="0"
<tr<td width="100%"<table border="0" width="100%" bgcolor="#000000" cellspacing="0" cellpadding="0"
<tr<td width="100%"<table border="0" cellspacing="1" width="100%" align=left height="320"
<tr<td width="100%" bgcolor="#FFB500" align=center height="31"<font color="#804000"<span style="font-size: 11pt"同学录 出错</span</font</td
</tr<tr<td width="100%" align=left height="247" bgcolor="#F7F7F7"<span style="font-size: 11pt"<p align="center"
出错原因:<font color="#FF0000"<? echo $msg;?</font</p<p align="center"<a href="javascript:history.go(-1);"<font color="#000000"请点这里返回上一页检查你的输入是否有误</font</a</p
<p align="center"[ <a href="javascript:history.go(-1);"返回上一页</a ]</p</span</td</tr<tr<td width="100%" bgcolor="#FFB500" height="30"<p align="right"<span   
style="font-size: 9pt"<font color="#804000"Copyright 200x y10k </font<font face="Arial" color="#804000".Allrights reserved.</font</span</td
</tr</table</td</tr</table</td</tr</table</center</body</html
<?
}
?

5、登陆文件login.php3
<?
require("common.php3");
if($submit){
$id=chop($id);
  if($id=="")error("请输入您的用户名称!");
  else{
    $dbm=dbmopen("password","r");
    if(!dbmexists($dbm,$id))error("没有这个用户名称!");
    else{
      $pass=dbmfetch($dbm,$id);
      if($pass==$password){
        setcookie("login",$id,time()+31536000);
        header("location:index.php3");
      }else error("您的密码不对!如果忘记密码,请使用忘记密码功能!");
    }
    dbmclose($dbm);
  }
}else{
?
<html
<head
<title深圳中学2000届高中(12)班同学录:::版权所有:辛湜@深圳中学2000届高中(12

来源:https://www.tulaoshi.com/n/20160129/1493413.html

延伸阅读
标签: PHP
  成员主页:main.php <? session_start(); // 开始session session_register("userregister"); $userregister=$username; include "class/config.php"; $result = mysql_query("SELECT * FROM user where user='$username'",$db); if (mysql_num_rows($result)==0){  //若返回列的数...
标签: PHP
  客人主页:class/guest.php <HTML <HEAD <meta http-equiv="Content-Type" content="text/html; charset=gb2312" <TITLE欢迎来到94级1班同学录</TITLE <style type="text/css" <!-- .deepblue10 {  font-family: "宋体"; font-size: 10pt; color: #3333...
标签: Web开发
(一)简介 本文尝试对PHP程序加速的各个方面进行探索,包括必要性以及从不同角度采取的具体措施。希望有助于读者了解PHP程序加速,并应用于实际。 (二)是否需要加速? 这个问题听起来有点愚蠢。在这个时代,很少有人会怀疑时间是最宝贵的财富,尤其是在商业市场上。程序执行越快,用户就节约越多的时间,这样你的程序就...
标签: PHP
  本程序将中文日期输出为2001-12-23,并很好解决了“十”的问题,如“十一”和“二十一”中“十”的处理!稍加修改可改为函数。 <? $str="二零○一年十二月二十三日"; echo $str."<p"; $flag=0; $cn=array("一","二","三","四","五","六&quo...
标签: PHP
  1)文本计数器 <?php $countfile="/count.txt";  //设置保存数据的文件 if (!file_exists($countfile)){//判断文件是否存在 exec( "echo 0 $countfile"); } $fp = fopen($countfile,"rw"); $length=filesize($countfile); $num = fgets($fp,$length); $num += 1; exec( "rm -rf $...

经验教程

211

收藏

95
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部