我只是進入MySQL,我正在創建一個基本的註冊頁面。然而,當我點擊提交時,我想要被引導到另一個頁面,說你登錄的頁面,儘可能多的網站。添加一個鏈接到一個HTML提交按鈕
如何讓提交按鈕鏈接到新頁面。我知道這會很簡單,但我看起來似乎並沒有發現太多。
這是我試過的當前代碼:
<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>
爲什麼不直接從你的'rego.php重定向'腳本? – jackbot
你是什麼意思? – ReallyGoodPie
您希望在rego.php中進行一些處理(即向數據庫添加記錄或通知用戶他們已經使用該電子郵件地址進行了註冊)。因此,在插入新記錄後,將用戶重定向到登錄頁面。 – jackbot