TA的每日心情 | 擦汗 2016-12-6 16:04 |
---|
签到天数: 10 天 [LV.3]偶尔看看II
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
修改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));
复制代码 你的风格/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>
复制代码 再在<!--{template header}-->下面添加
- <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);">
复制代码 |
|