我刚刚进入 mysql,我正在创建一个基本的注册页面。但是,当我单击提交时,我想被定向到另一个页面,比如说您登录的页面,就像许多网站一样。
我如何允许提交按钮链接到新页面。我知道这将是一些简单的事情,但我已经看过并且似乎找不到太多关于它的内容。
这是我尝试过的当前代码:
<html>
<head>
<title>MySQL Test - Registration</title>
<script LANGUAGE="JavaScript">
function testResults() {
window.document.location.href = "http://www.google.com";
}
</script>
</head>
<body>
<form action = "rego.php" method = "POST">
Username:<br/>
<input type = "text" name = "username"/><br/>
Password:<br/>
<input type = "password" name = "password"/><br/>
Confirm Password:<br/>
<input type = "password" name = "passvery"/><br/>
Email:<br/>
<input type = "text" name = "email"/><br/><br/>
Please select your gender:<br/>
<input type = "radio" name = "gender" value = "male"/>Male      
<input type = "radio" name = "gender" value = "female"/>Female<br/><br/>
<input type = "checkbox" name = "agree" value = "agree"/>I agree to the terms and conditions.<br/>
<br/>
<input type = "submit" value = "Sign Up!" onclick = "javascript:testresults()" />
</form>
</body>
</html>