程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> 我的論壇源代碼(八)

我的論壇源代碼(八)

編輯:關於PHP編程

reguse.php用戶注冊與登錄頁面

<?
if ($action==dl&&$uname)
{
$uinfo=$uname."|".$upass;
setcookie("FlyFoxNet",$uinfo,time()+3600);
}
?>
<html>
<head>
<title>用戶注冊</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>
P {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt}
DIV {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt}
</STYLE>
<LINK href="js/cpcw.css" rel=stylesheet /LINK>
</head>
<?php
include "linkfox.inc.php";
include "info.inc.php";
include "reguse.inc.php";

function dlokey($user)      //登錄成功顯示
{
echo "<script language='JavaScript'> alert('".$user3."歡迎你再次來到狐網論壇,站長飛狐||黑暗居士歡迎你!你上次來訪的時間是".$user[2]."'); </script>";
echo "<table width='50%' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#000000'>";
echo "<tr><td><table width='100%' border='0' cellspacing='1' cellpadding='1'><tr bgcolor='#006699'><td>";
echo "<div align='center'><font color='#FFFFFF'>歡迎你!<font color='00ff00'>".$user[3]."</font></font></div></td></tr><tr bgcolor='#eeeeee'><td>";
echo "<div align='center'>你上次訪問本站的時間是:<font color='009900'>".$user[2]."</font></div></td></tr><tr bgcolor='#eeeeee'>";
echo "<td><div align='center'>你現在可以<a href='post.php'> <發布新帖> </a><a href='foxbbs.php'> <查看主題></a> <a href='useinfo.php?action=edit'> <修改信息></a></div></td></tr>";
echo "</table></td></tr></table>";
}




?>
<body bgcolor="#FFFFFF">
<table width="100%" cellpadding="4" cellspacing="0" border="0">
  <tr>
    <td height="20">
      <div align="right"></div>
    </td>
    <td height="20" width="75"> </td>
    <td height="20" width="75"> </td>
    <td height="20" width="75"> </td>
    <td height="20" width="75"> </td>
  </tr>
  <tr>
    <td height="20">
      <div align="right"></div>
    </td>
    <td height="20" width="75">
      <div align="center"><img src="images/top_register.gif" width="74" height="21" border="0"></div>
    </td>
    <td height="20" width="75">
      <div align="center"><img src="images/top_members.gif" width="74" height="21"></div>
    </td>
    <td height="20" width="75"><img src="images/top_profile.gif" width="74" height="21"></td>
    <td height="20" width="75"><a href="okey.php?d=q"><img src="images/top_logout.gif" width="74" height="21" border="0"></a></td>
  </tr>
  <tr>
    <td height="20">
      <div align="left">當前位置:<font color="#0000FF">狐網─>狐網論壇─>會員注冊</font></div>
    </td>
    <td height="20" width="75">
      <div align="center"><a href="foxbbs.php"><img src="images/index.gif" width="70" height="20" border="0"></a></div>
    </td>
    <td height="20" width="75">
      <div align="center"><a href="post.php"><img src="images/newthread.gif" width="70" height="20" border="0"></a></div>
    </td>
    <td height="20" width="75"><a href="superuse.php"><img src="images/super.gif" width="70" height="20" border="0"></a></td>
    <td height="20" width="75">
      <div align="center"><a href="../index.php"><img src="images/fox.gif" width="70" height="20" border="0"></a></div>
    </td>
  </tr>
</table>
<?
if ($action==xy)
{
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0' bgcolor='#000000'><tr><td>";
echo "<table width='100%' border='0' cellspacing='1' cellpadding='1'>";
echo "<tr bgcolor='#006699'><td height='20'><div align='center'><font color='#FFFFFF'>狐網論壇 規定</font></div></td></tr>";
echo "<tr bgcolor='#eeeeee'><td height='20'>";
echo "<div align='left'><p>你在這個論壇注冊是完全免費的! 我們希望您遵守以下的論壇規定. 請仔細閱讀下列條款. 如果您同意請按 '我同意' 按鈕. 如果您不同意,";
echo "請按 '不同意' 按鈕退出.</p>";
echo "<p> 1. 遵守中華人民共和國的各項有關法律法規.</p>";
echo "<p> 2. 不得在發布任何色情非法, 以及危害國家安全的言論.</p>";
echo "<p> 3. 嚴禁鏈接有關政治, 色情, 宗教, 迷信等違法信息.</p>";
echo "<p> 4. 承擔一切因您的行為而直接或間接導致的民事或刑事法律責任; </p>";
echo "<p> 5. 互相尊重, 遵守互聯網絡道德; 嚴禁互相惡意攻擊, 漫罵;</p>";
echo "<p> 6. 管理員及版主有權保留或刪除論壇中的任意內容;</p>";
echo "<p> 7. 本站網管擁有一切管理權力. </p>";
echo "<p> 8. 在此論壇發表的原創文章,版權規作者與狐網共有。</p>";
echo "</div></td></tr></table>";
echo "</td></tr></table>";
echo "<div align='center'><FORM ACTION='reguse.php' METHOD='get'><INPUT TYPE='HIDDEN' NAME='action' VALUE='reg'>";
echo "<INPUT TYPE='SUBMIT' VALUE='我同意'></p></form>";
echo "<div align='center'><FORM ACTION='foxbbs.php' METHOD='get'><INPUT TYPE='SUBMIT' VALUE='不同意'></p></form>";
}
else if ($action==reg)
{
usemess("請在下表填寫注冊信息",'必填','必填','必填','必填','必填','必填','必填');
}
if ($action==add)
{
  if ($useni)        //如果有信息
     {
          for ($i=0;$i<10;$i++)
        {
          if ($bq[$i]) $usebq=$bq[$i];
        }
    $reginfo=reg($usename,$usepass,$usemail,$useweb,$useni,$useoicq,$usesex,$useage,$usezy,$useaddr,$useinf,$usety,$usebq,$useqm);
    switch ($reginfo)
      {
      case ($reginfo==1):
        usemess("錯誤!用戶名超長",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
        break;
      case ($reginfo==2):
        usemess("錯誤!密碼超長",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
        break;
      case ($reginfo==3):
        usemess("錯誤!oicq號非法",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
        break;
      case ($reginfo==4):
        usemess("錯誤!用戶密碼含有非法字符",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
        break;
      case ($reginfo==5):
        usemess("錯誤!用戶名含有非法字符",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
        break;
      case ($reginfo==6):
        usemess("錯誤!非法OICQ號",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
        break;
      case ($reginfo==7):
        usemess("錯誤!非法EMAIL地址",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
        break;
      case ($reginfo==8):
        usemess("非常報歉!這個用戶已經存在,請重新選擇",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
        break;
      case ($reginfo==9):
        usemess("未知錯誤!",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
        break;
      case ($reginfo==10):
        usemess("寫入數據庫錯誤,請與<font color='ffffff'>黑暗居士</font>聯系",$usename,$usemail,$useweb,$useni,$useoicq,$useaddr,$useqm);
        break;
      default:
        $reginfo=update($reginfo);
        regok("注冊成功,以下是你的個人信息",$reginfo);
        break;
      }
    }
    else usemess("請填寫好你的信息",'必填','必填','必填','必填','必填','必填','必填');
}
if ($action==dl)      //登錄函數
{
  if ($uname)
   {
     $query="select usepass,usename,enddate,useni from useinfo where usename='".$uname."'";  //檢查是否存在用戶
     $req=@mysql_query($query);
       if ($req)
        {
         $user=@mysql_fetch_array($req);
         if ($user[0]==$upass)              //檢查口令是否正確
          {
          $time=date(Y年n月j日G時i分);
          $query="update useinfo set enddate='$time' where usename='".$uname."'";
          $req=@mysql_query($query);
          if ($req) dlokey($user);
          else dlmes("數據登錄錯誤!");
          }
         else dlmes("用戶密碼不正確,請校驗!");
       }
       else dlmes("不能找到用戶信息,請確認!如果還未注冊,請點擊<a href='reguse.php?action=xy'>這裡</a>");
  }
else dlmes("用戶登錄");
}
?>
</body>
</html> 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved