📄 tpl_register.php
字号:
<!-- tpl_register.php -->
<h1>User Registration</h1>
<p>Please fill out the form below. All fields are required. Please enter a valid email address as you may be required to activate your account.</p>
<?php /* Errors will be printed here */ if ( isset ( $error ) ) print $error; ?>
<form action="<?=MOD_REWRITE?'register':'account.php?action=register'?>" method="post" id="registration_form">
<input type="hidden" name="action" value="register" />
<input type="hidden" name="task" value="register" />
<table cellspacing="1" cellpadding="2" style="margin-top:5px;">
<tr>
<td style="width:120px;" class="tt">Username</td>
<td style="line-height:1.7em;">
<input type="text" name="userinfo[name]" id="userinfo[name]" value="<?=$userinfo['name']?>" size="30" maxlength="<?=$restrictions['name_max_len'] > 0 ? $restrictions['name_max_len'] : 100 ?>" />
</td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="userinfo[pass1]" id="userinfo[pass1]" value="" size="30" maxlength="30" /></td>
</tr>
<tr>
<td>Confirm password</td>
<td><input type="password" name="userinfo[pass2]" id="userinfo[pass2]" value="" size="30" maxlength="30" /></td>
</tr>
<tr>
<td>Email address</td>
<td><input type="text" name="userinfo[email]" id="userinfo[email]" value="<?=$userinfo['email']?>" size="50" maxlength="100" /></td>
</tr>
<tr>
<td class="tt">Preferences</td>
<td>
<ul class="ls_menu">
<li><input type="checkbox" class="chkbox" name="userinfo[pemail]" id="userinfo[pemail]" value="1" <?=$userinfo['pemail']?'checked="checked"':''?>/> <label for="userinfo[pemail]">Allow other users to see my email address</label></li>
<li><input type="checkbox" class="chkbox" name="userinfo[pmessage]" id="userinfo[pmessage]" value="1" <?=$userinfo['pmessage']?'checked="checked"':''?>/> <label for="userinfo[pmessage]">Accept private messages from other users</label></li>
</ul>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" class="blue_button" value="Register" /> <input type="button" class="blue_button" value="Cancel" onclick="go('index.php');" /></td>
</tr>
</table>
</form>
<script type="text/javascript">
var username = getObj ( 'userinfo[name]' );
var password1 = getObj ( 'userinfo[pass1]' );
var password2 = getObj ( 'userinfo[pass2]' );
var timer = new Timer;
if ( username ) username.bubble = new Bubble ( username, 0, 350 );
if ( password2 ) password2.bubble = new Bubble ( password2, 0, 350 );
function checkName ( )
{
if ( username )
{
var checkURL = 'account.php?action=checkname&simple=1&name=' + escape ( username.value );
var check = function ( result )
{
if ( result != 'OK' ) username.bubble.display ( ' <img src="templates/default2/images/ex.gif" class="img1" alt="" /> ' + result );
else
{
username.bubble.display ( ' <img src="templates/default2/images/check.gif" class="img1" alt="" /> ' + result );
timer.start('username.bubble.hide()',1000);
}
}
xmlhttpGet(checkURL,check);
}
}
function checkPassword ( )
{
if ( !password1 || !password2 ) return false;
if ( password2.value != '' && password1.value != password2.value )
{
password2.bubble.hide();
password2.bubble.display('The passwords you entered do not match. Please enter the same password in both fields.');
}
else password2.bubble.hide();
return true;
}
function focusUsernameField ( )
{
var usernameField = getObj ( 'userinfo[name]' );
if ( usernameField ) usernameField.focus();
return true;
}
addEvent ( username, 'keyup', function() { timer.stop();timer.start('checkName()',500); } );
addEvent ( password2, 'blur', checkPassword );
addEvent ( password2, 'keyup', checkPassword );
addLoadEvent ( focusUsernameField );
-->
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -