演示地址http://www.86027wh.cn/do.php?ac=c54f4c2375aabdaa896fc5c48077d4e5
在
source/do_register.php
找到
//开通空间
include_once(S_ROOT.'./source/function_space.php');
$space = space_open($newuid, $username, 0, $email);
在其下面加上
//家乡、居住地和性别
$jiasetarr = array(
'uid' => $newuid,
'sex' => $_POST['sex'],
'birthprovince' => $_POST['birthprovince'],
'birthcity' => $_POST['birthcity'],
'resideprovince' => $_POST['resideprovince'],
'residecity' => $_POST['residecity']);
updatetable('spacefield', $jiasetarr, array('uid'=>$newuid));
default/do_register.htm
找到
<tr><th>邮箱</th><td><input type="text" id="email" name="email" value="@" class="t_input" tabindex="5" />
<br>请准确填入您的邮箱,在忘记密码,或者您使用邮件通知功能时,会发送邮件到该邮箱。</td></tr>
在其下面加入
<tr><th>性别</th>
<td><label for="sexm">
<input id="sexm" type="radio" value="1" name="sex" checked>男</label>
<label for="sexw"><input id="sexw" type="radio" value="2" name="sex">女</label>
<span style="font-weight:bold;color:red;">(性别选择确定后,将不能再次修改)</span></td>
</tr>
<tr><th>家乡</th>
<td><script type="text/javascript" src="source/script_city.js"></script>
<script type="text/javascript">
<!--
showprovince('birthprovince', 'birthcity', '$space[birthprovince]');
showcity('birthcity', '$space[birthcity]', 'birthprovince');
//-->
</script></td>
</tr>
<tr><th>居住地</th>
<td><script type="text/javascript">
<!--
showprovince('resideprovince', 'residecity', '$space[resideprovince]');
showcity('residecity', '$space[residecity]', 'resideprovince');
//-->
</script></td>
</tr>
再在<head></head>之间加入
<script type="text/javascript">
function validate(obj) {
var subject = $('birthprovince'); //判断城区是否合法
if (subject) {
var slen = strlen(subject.value);
if (slen == 0) {
alert("请选择您所在家乡的城区");
subject.focus();
return false;
}
}
var subject = $('birthcity'); //判断乡镇是否合法
if (subject) {
var slen = strlen(subject.value);
if (slen == 0) {
alert("请选择您所在家乡的乡镇");
subject.focus();
return false;
}
}
var subject = $('resideprovince'); //判断城区是否合法
if (subject) {
var slen = strlen(subject.value);
if (slen == 0) {
alert("请选择您所在居住的城区");
subject.focus();
return false;
}
}
var subject = $('residecity'); //判断乡镇是否合法
if (subject) {
var slen = strlen(subject.value);
if (slen == 0) {
alert("请选择您所在居住的乡镇");
subject.focus();
return false;
}
}
}
</script>
再把<form id="registerform" name="registerform" action="do.php?ac=$_SCONFIG[register_action]&$url_plus&ref" method="post" class="c_form">
修改成
<form id="registerform" name="registerform" action="do.php?ac=$_SCONFIG[register_action]&$url_plus&ref" method="post" class="c_form" onsubmit="return validate(this);"> |