📄 reg.php
字号:
<?php
//
// Copyright (c) 2004 All rights reserved.
// Author: andy_lue (xidian university)
// email: andy_lue.mail@eyou.com
//
?>
<html>
<head>
<title>Counter Registering</title>
<link href='../style/main.css' rel='stylesheet' type='text/css'>
<script language="javascript">
function reset_ornot(){
var msg = "你真的要重填表单么?";
if(confirm(msg)){
document.reg.uid.value="";
document.reg.pass.value="";
document.reg.conpass.value="";
}
else{
return false;
}
}
function validate(){
if(document.reg.uid.value=='' || document.reg.pass.value==''){
alert("请完全填写!");
return false;
}
else if(document.reg.pass.value != document.reg.conpass.value){
alert("两次输入的密码不一致!");
return false;
}
else{
return true;
}
}
</script>
</head>
<body>
<?php
include("functions.php");
if(isset($HTTP_POST_VARS['uid']) && isset($HTTP_POST_VARS['pass'])){
$uid = $HTTP_POST_VARS['uid'];
$pass = $HTTP_POST_VARS['pass'];
$success = "
注册成功!你的用户名: $uid 你的密码: $pass
<br><font color='#FF0000'>请牢记,用户名和密码!</font>
默认计数器为:<script language=\"javascript\" src=\"http://localhost/php/counter/counter.php?uid=$uid&style=1&bits=6\"></script><br>
<textarea cols='50' rows='4'><script language=\"javascript\" src=\"http://localhost/php/counter/counter.php?uid=$uid&style=1&bits=6\"></script></textarea>
<br>*使用方法:<br> <font color='red'>将上面的代码加入到你要计数的网页当中。</font>
<br> style是计数器的风格,共六种,可以是 0 - 5 任何一种;
<br> bits是计数器的位数,可以是 3 - 10 位。
";
$failed = "
注册失败,用户已存在!<a class='link_2' href='reg.php'>返回注册</a>
";
?>
<table height="0" border=0 align=left>
<tr>
<td align="">
<?= reg_user($uid,$pass) ? $success : $failed;?>
</td>
</tr>
</table>
<?php
}
else{
?>
<table height="100" border=0 align=left>
<tr>
<td>
<form method="post" action="" name="reg" onsubmit="return validate();">
<tr>
<td>用户名: </td>
<td><input style="width:120px;height:20px;border:1px dashed #c0c0c0;" type="text" name="uid" value=""></td>
</tr>
<tr>
<td>密码: </td>
<td><input style="width:120px;height:20px;border:1px dashed #c0c0c0;" type="password" name="pass" value=""></td>
</tr>
<tr>
<td>确认密码:</td>
<td><input style="width:120px;height:20px;border:1px dashed #c0c0c0;" type="password" name="conpass" value=""></td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="button" name="mybutton" value="reset" onclick="reset_ornot();">
<input type="submit" name="reg" value="submit">
</td>
</tr>
</form>
</td>
</tr>
</table>
<?php
}
?>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -