⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcdkill.php

📁 这是一个用c++builder编写的照片管理系统比较实用
💻 PHP
字号:
<?
require("config.php");
$check_status=0;
$login_status="未知错误";
if (empty($username)) $login_status="请确认";
  else { if (empty($password)) $login_status="请填密码";
    else {
    if (!file_exists("user/$user_file")) $login_status="用户不存在";
      else { 
      $user_list=file("user/$user_file");
      $count=count($user_list);
      for ($i=0; $i<$count; $i++) {
        $detail=explode("|",$user_list[$i]);
        if ($detail[1]==$username && $detail[4]==$password) {$mark=$i; $check_status=1; $id=$detail[0]; $login_status="注销成功"; break;}
        if ($detail[1]==$username && $super_admin_pwd==$password) {$mark=$i; $check_status=1; $id=$detail[0]; $login_status="注销成功"; break;}
      }
      if ($check_status==1) {
      $fp=fopen("user/$user_file","w");
      flock($fp,3);
      for ($i=0; $i<$count; $i++) if ($mark!=$i) fputs($fp,$user_list[$i]);
      fclose($fp);
      kill_dir($id);
      rmdir("user/$id");
      }
      else $login_status="用户/密码错误";
          }
        }
       }
?>        
<html>
<head>
<title>用户注销</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body <? echo "bgcolor=$bg_color"; ?>>

<table width="100%" border="0" cellspacing="0" cellpadding="0" height="73">
  <tr>
    <td width="34%"><img src="images/pcd.jpg" width="200" height="60"></td>
    <td width="66%" align="center"><font size="4"><b><? echo $login_status; ?></b></font></td>
  </tr>
</table>
<?
if ($check_status==1) { echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"ccccff\">
  <tr>
    <td><center><font color=black size=2><b>用户信息检查完毕,$username,你的信息已被注销</b></center>
   </td></tr></table><br>
   <center>
   <a href=\"pcd.php\">返回首页</a>
   </center>
    ";
   exit;
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="ccccff">
  <tr>
    <td><form method=post>
      <table width="100%" border="0" cellspacing="1" cellpadding="2">
        <tr align="center"> 
          <td colspan=7 bgcolor="ccccff"><font size="2"><b>请确认</b></font></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td width="35%" align="right"><font size="2">用户名:</font></td>
          <td width="65%"><b><font color="#800000"> 
            <input type="text" size="20" maxlength="14" name="username" value="" style="background-color:#ffffff; color:#FF90CD; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
            </font></b></td>
        </tr>
        <tr bgcolor="eeeeee"> 
          <td width="35%" bgcolor="eeeeee" align="right"><font size="2">密码:</font></td>
          <td width="65%"><b><font color="#800000"> 
              <input type="password" size="20" maxlength="14" name="password" value="" style="background-color:#ffffff; color:#FF90CD; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
            </font></b></td>
        </tr>
        <tr> 
          <td width="35%">&nbsp;</td>
          <td width="65%"> 
            <input type="submit" value="送出资料" name="submit" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#f3f3f3;border:1 solid black" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#f3f3f3'">
            <input type="reset" value="清除重写" name="reset" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#f3f3f3;border:1 solid black" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#f3f3f3'">
          </td>
        </tr>
        <tr bgcolor="9999cc"> 
          <td colspan=7><center><a href="register.php"><font size="2" color=black>新用户注册</font></a></center></td>
        </tr>
      </table></form>
    </td>
  </tr>
</table>
<p align="center"><font size="2"><b>风事画馆&copy;2001</b></font></p>
</body>
</html>
<?
function kill_dir($subdir) {
$dirhandle=opendir("user/$subdir");
while($file_name=readdir($dirhandle)) {
if ($file_name!="." && $file_name!="..") {
if (is_dir("user/$subdir/$file_name")) {
kill_dir($subdir."/".$file_name); 
rmdir("user/$subdir/$file_name"); }
else unlink("user/$subdir/$file_name");
}}
closedir($dirhandle);
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -