1、前台界面register.php文件
<?php
//定义了变量,用来授权includes里面的文件;
define('IN_TG', true);
//引入公共文件;
//require 'includes/common.inc.php';
require dirname(_FILE_).'includes/common.inc.php'; //转换为硬路径,速度快;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="textml; charset=utf-8" />
<title>多用户留言系统——注册</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="style/style1/basic.css" />
<link rel="stylesheet" type="text/css" href="style/style1/register.css" />
</head>
<body>
<!-- 头部 -->
<?php
//require 'includes/header.inc.php';
//第二种:采用硬路径;
require ROOT_PATH.'includes/header.inc.php';
?>
<div id="register">
<h2></h2>
<form method="post" action="post.php">
<dl>
<dt>请详细填写一下内容</dt>
<dd>用 户 名:<input type="text" name="username" class="text" />(*必填 ,至少2位)</dd>
<dd>密 码:<input type="password" name="password" class="text" />(*必填,至少6位)</dd>
<dd>确定密码:<input type="password" name="notpassword" class="text" />(*必填,同上)</dd>
<dd>密码提示:<input type="text" name="passt" class="text" />(*必填,至少2位)</dd>
<dd>密码回答:<input type="text" name="passd" class="text" />(*必填,至少2位)</dd>
<dd>性 别:<input type="radio" name="sex" value="男" checked="checked"/>男<input type="radio" name="sex" value="女" />女</dd>
<dd class="face"><img src="face/01.jpg" alt="头像选择" οnclick="javascript:window.open('face.php','face','width=400,height=400,top=0,left=0')"/></dd>
<dd>电子邮件:<input type="text" name="email" class="text" /></dd>
<dd> Q Q :<input type="text" name="qq" class="text" /></dd>
<dd>主页地址:<input type="text" name="url" class="text" /></dd>
<dd>验 证 码:<input type="text" name="yzm" class="text-yzm" /></dd>
<dd><input type="submit" class="submit" value="注册" /></dd>
</dl>
</form>
</div>
<!-- 尾部 -->
<?php
//require 'includes/footer.inc.php';
require dirname(_FILE_).'includes/footer.inc.php';
?>
</body>
</html>
2、注册页面样式文件register.css
@CHARSET "UTF-8";
#register{
width:auto;
height:600px;
border:2px solid #ccc;
font-size:12px;
}
#register h2{
text-indent:0;
text-align:center;
}
#register dl{
width:400px;
margin:0 auto;
}
#register dl dt{
text-align:center;
padding:10px 0;
font-weight:blod;
}
#register dl dd{
padding:5px 0;
}
#register dl dd .face{
padding:5 0 5 120px;
}
#register dl dd .face img{
cursor:pointer;
}
#register dl dd input.text{
width:220px;
height:19px;
border:1px solid dashed #333;
background:#fff;
}
#register dl dd input.text-yzm{
width:60px;
height:19px;
border:1px solid dashed #333;
background:#fff;
}
#register dl dd input.submit{
width:60px;
height:19px;
border:1px dashed #333;
background:#fff;
cursor:pointer;
margin:0 0 0 120px;
}
上述案例代码运行界面,如下所示(由于之前header头部、footer尾部界面有所显示,所以只显示中 间的会员注册界面)