本欄目下相關鏈接


登錄表單的製作

很多用戶會在主頁上放一個論壇入口,這樣訪問者就可以從首頁直接登錄論壇,而不必再先進入論壇再登錄。下面提供的 html 代碼可以 示範如何從首頁登錄 Discuz! 論壇。這段代碼只是示範一下登錄表單的工作原理,具體的界面、顯示等需要您根據頁面情況自行修改。

如果當這段代碼不是放在論壇目錄裡,則需要把與程序相關的文件名(logging.php,register.php,index.php)加上論壇的路徑。如 logging.php?action=login 改為 http://your.com/discuz/logging.php?action=login。


	<html>
	<head>
	<title>login</title>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
	</head>
	
	<body>
	
	<form method="post" action="logging.php?action=login" target="_blank">
	  <input type="hidden" name="referer" value="index.php">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
	    <tr> 
	      <td>用戶名</td>
	      <td>
	        <input type="text" name="username">
	      </td>
	    </tr>
	    <tr> 
	      <td>密碼</td>
	      <td>
	        <input type="password" name="password">
	      </td>
	    </tr>
	    <tr>
	      <td colspan="2">
	        <input type="submit" name="loginsubmit" value="登錄">
	        <input type="reset" name="reset" value="重置">
	        <input type="button" value="註冊" onclick="javascript: this.form.action='register.php';this.form.submit();">
	        <input type="button" value="遊客" onclick="javascript: this.form.action='index.php';this.form.submit();">
	      </td>
	    </tr>
	  </table>
	</form>
	
	</body>
	</html>