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

基於mysql的論壇(2)

編輯:PHP綜合
#################################
## apply.php ####################
#################################
<html>
<head>
<title>注冊用戶</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<body bgcolor="#FFFFFF" background="image/bg.gif">
<?php include "header.php";?>
<br>
<hr noshade width="97%" size="1">
<div align="center">注冊新用戶<br>
</div>
<table width="90%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#336699" bordercolordark="#FFFFFF" align="center">
  <tr>
      <td colspan="2">
        <div align="center">
          <textarea name="temp" wrap="VIRTUAL" cols="60" rows="8">注冊須知:
  
  用戶只有注冊之後,才能有權發新貼子和回復貼子。非注冊用戶只能察看貼子。
  注冊項目中,帶“*”的是您必須填寫的項目,其他是可選項目。不過,為了聯系方便,最好將資料寫的詳細一些。
  本論壇不歡迎有關政治敏感話題,如果由此引起糾紛,本論壇使用管理者不負責任。
  在注冊之後,每發一篇貼子,增加5點積分,回復一篇,增加3點,被刪除一篇,扣除4點。積分只是為了活躍論壇氣氛,不代表網友的某方面水平。
  
          制作:冷情瘋子</textarea>
        </div>
      </td>
    </tr>
    <tr valign="top">
      <td colspan="2">  </td>
    </tr>
    <tr>
      <td colspan="2">
        <form method="post" action="adduser.php">
          <table width="80%" border="0" cellspacing="0" cellpadding="3" align="center">
            <tr>
              <td align="right">用戶名</td>
              <td>
                <input type="text" name="name" maxlength="16" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000">
                * </td>
            </tr>
            <tr>
              <td align="right">密碼</td>
              <td>
                <input type="password" name="pwd1" maxlength="8" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="9">
                * </td>
            </tr>
            <tr>
              <td align="right">重復密碼</td>
              <td>
                <input type="password" name="pwd2" maxlength="8" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="9">
                * </td>
            </tr>
            <tr>
              <td align="right">Email</td>
              <td>
                <input type="text" name="email" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000">
                 </td>
            </tr>
            <tr>
              <td align="right">性別</td>
              <td>
                <select name="sex">
                  <option value="秘密" selected>秘密</option>
                  <option value="男">男</option>
                  <option value="女">女</option>
                </select>
              </td>
            </tr>
            <tr>
              <td align="right">真實性名</td>
              <td>
                <input type="text" name="realname" size="17" maxlength="16" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000">
              </td>
            </tr>
            <tr>
              <td align="right">地址</td>
              <td>
                <input type="text" name="address" maxlength="40" size="30" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000">
              </td>
            </tr>
            <tr>
              <td align="right">電話</td>
              <td>
                <input type="text" name="phone" size="22" maxlength="20" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000">
              </td>
            </tr>
            <tr>
              <td align="right">主頁</td>
              <td>
                <input type="text" name="homepage" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="50" value="http://">
              </td>
            </tr>
            <tr>
              <td align="right">OICQ</td>
              <td>
                <input type="text" name="oicq" maxlength="11" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="12">
              </td>
            </tr>
            <tr>
              <td align="right">簽名</td>
              <td>
                <textarea name="qm" wrap="VIRTUAL" cols="50"></textarea>
              </td>
            </tr>
            <tr>
              <td align="right">  </td>
              <td align="center">
                <input type="submit" name="b1" value="注冊">
                <input type="reset" name="Submit2" value="清除" >
              </td>
            </tr>
          </table>
        </form>
      </td>
    </tr>
  </table>
<br>

<?php include "footer.php";?>

</body>
</html>
##########################################
## chklogin.php #########################
########################################
<?php
require ("func.php");
$name=trim($name);
$password=trim($password);
$sql="select * from user where name='$name'";
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result);
if (($password==$sql_row[password])and(!empty($sql_row[slaveboard]))){
    setcookie("jl_forum[board]",$sql_row[slaveboard]);
    setcookie("jl_forum[name]",$name);
    setcookie("jl_forum[password]",$password);
    redirect2("manage_list.php");
}
else {
    show_error(4);
}
?>
###################################
#####  config.inc.php ##########
#############################
<?

  $MYSQL_HOSTNAME = "localhost";
  $MYSQL_USERNAME = "root";
  $MYSQL_PASSWORD = "";

  $DATABASE = "forum";

  $pagesize=25;

  $copyright="Copyright © 2000, by Edincur, All Rights Reserved<BR>";

  $admin_email="your_email";

  $admin_name="your_admin_name";         #論壇管理員名稱
  $admin_password="your_password";       #論壇管理員密碼

  $remove_score=4;  #被刪除一篇扣除的分數
  $new_topic_score=5;   #發表新主題的分數
  $re_topic_score=3;   #回復一篇的分數

  mysql_connect($MYSQL_HOSTNAME, $MYSQL_USERNAME, $MYSQL_PASSWORD);
  mysql_select_db($DATABASE) or die(mysql_error());

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