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

📄 user_register.php

📁 蓝芒图书管理系统 蓝芒图书管理系统 蓝芒图书管理系统
💻 PHP
字号:
<?php
include("header.php");
include("checking.php");
function listeditor()
{
	echo "";
}
if($mode==""):
?>
<div align="center">
  <center>
  <p align class="1">新用户登记</p>
  <table border="1" width="80%" bordercolor="#000000" cellspacing="0" cellpadding="0">
    <tr>
      <td width="100%">
      <form action="user_register.php?mode=doit" method="post">
        <table border="0" width="100%" cellspacing="0" cellpadding="0" height="86">
          <tr>
            <td width="50%" height="18" align="right">姓名*:</td>
            <td width="50%" height="18"><input type="text" name="name" size="20"></td>
          </tr>
          <tr>
            <td width="50%" height="18" align="right">证件号码*:</td>
            <td width="50%" height="18"><input type="text" name="document" size="20"></td>
          </tr>
          <tr>
            <td width="50%" height="18" align="right">编号*:</td>
            <td width="50%" height="18"><input type="text" name="editor" size="20" value="<?php listeditor()?>"></td>
          </tr>
          <tr>
            <td width="50%" height="18" align="right">住址*:</td>
            <td width="50%" height="18"><input type="text" name="dress" size="20"></td>
          </tr>
          <tr>
            <td width="50%" height="18" align="right">Email:</td>
            <td width="50%" height="18"><input type="text" name="email" size="20"></td>
          </tr>
          <tr>
            <td width="50%" height="18" align="right">电话*:</td>
            <td width="50%" height="18"><input type="text" name="phone" size="20" value=0 ></td>
          </tr>
          <tr>
            <td width="50%" height="18" align="right">密码*:</td>
            <td width="50%" height="18"><input type="password" name="passwords" size="20"></td>
          </tr>
<?php
if($flag!=0):
?>    
          <tr>
            <td width="50%" height="14" colspan="2" align="right">
              <p align="center"><br><input type="submit" name="T7" size="20" value="提交"><input type="reset" name="T7" size="20"></p>
            </td>
          </tr>
<?php
endif;
?>
        </table>
        </form>
      </td>
    </tr>
  </table>
  </center>
</div>
<?php
endif;
if($mode=="doit")
{
	if($name=="" || $document=="" || $editor=="" || $dress=="" || password=="")
	{
		echo "<p align=center>所有选项不能为空";
		echo "<br><a href=\"javascript:history.back()\">返回</a>";
		exit();
	}
	if($email!="")
		if(!strpos($email,"@") || !strpos($email,"."))
		{
			echo "<p align=center>Email地址格式错误";
			echo "<br><a href=\"javascript:history.back()\">返回</a>";
			exit();
		}
	$sql="select id from user where editor='".$editor."'";
	$rs=mysql_query($sql,$conn);
	if(mysql_num_rows($rs)!=0)
	{
		echo "<p align=center>出现相同的编号";
		echo "<br><a href=\"javascript:history.back()\">返回</a>";
		exit();
	}
	$sql="select id from user where document='".$document."'";
	$rs=mysql_query($sql,$conn);
	if(mysql_num_rows($rs)!=0)
		if($parety_document)
		{
			echo "<p align=center>出现相同证件号码";
			echo "<br><a href=\"javascript:history.back()\">返回</a>";
			exit();
		}
		else
			$paretys=1;
	$sql="insert into user (document,name,dress,phone,password,editor,email) values";
	$sql.="('".$document."','".$name."','".$dress."','".$phone."','".$passwords."','".$editor."','".$email."')";
	//echo $sql;
	@mysql_query($sql,$conn) or die ("<p align=center>录入时发生错误");
	if($papared_id)
	{
		$sql="delete from papared_user where id=".$papared_id;
		if(!mysql_query($sql,$conn))
			echo "<p align=center>警告:删除网络注册记录时发生错误<br>";
	}
	echo "<p align=center>用户注册成功";
	if($paretys)
		echo "<br><font color=red><p align=center>警告:出现相同的证件号码</font>";	
}

mysql_close($conn);
?>
 

⌨️ 快捷键说明

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