'How do I direct the login button to another webpage?
How do I make the login button directly to another website? I am doing this for my small business and need help. What do people need to log in? I have already completed a registration form. I would really appreciate the help.
function check(form)
{
if(form.userid.value == "person" && form.pwd.value == "WachtWoord")
{
return true;
}
else
{
alert("Error Password or Username")
return false;
}
}
<html>
<body>
<form name="loginForm" method="post" action="login.php">
<table width="20%" bgcolor="ffffff" align="left">
<tr>
<td>Username:</td>
<td><input type="text" size=25 name="userid"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="Password" size=25 name="pwd"></td>
</tr>
<tr>
<td><input type="submit" onclick="location.website = 'https://www.otherwebsite.com';"></td>
</tr>
</table>
</form>
</body>
</html>
```
Solution 1:[1]
where the <form> tag is, inside of the action attribute, instead of 'login.php' you need to put the 'https://www.otherwebsite.com'.
Note: the submit input is NOT where you put the link you're going to.
Solution 2:[2]
I think the button should not redirect to another webpage but instead put a redirect webpage after authentication in login.php. you can check this for the tutorial link
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | BledyGames |
| Solution 2 | Friska S E Putri |
