AS
IF @UserName is null OR @PassWord is null OR @PassWord2 is null OR
@UserID is null
BEGIN RETURN 1
END
IF @UserName = @PassWord OR @UserName = @PassWord2
BEGIN RETURN 2
END
IF EXISTS(SELECT * FROM UserInfo WHERE UserName = @UserName)
BEGIN RETURN 3
END
IF @PassWord <> @PassWord2
BEGIN RETURN 4
END
INSERT INTO UserInfo (UserID,UserName,UserPass,UserPass2) VALUES
(@UserID,@UserName,@PassWord,@PassWord2)
RETURN 0
GO
第二步如下代码在login.php
网站ID:
登陆账号:
密 码:
确认密码:
第三步如下代码在MyGame_save.php
wbr>http://www.w3.org/TR/html4/loose.dtd">
提交
set_error_handler('myHandler');
function myHandler($code, $msg, $file, $line){
echo "Error at line $line.The error code was $code,and the reason
for the error was: $msg";
}
?>
switch($rt)
{
case 0: print("注册成功");break;
case 1: print("输入项目为空");break;
case 2: print("用户名和密码不能相同");break;
case 3: print("该用户名已注册");break;
case 4: print("输入的密码不一致");break;
}
?>