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>
```
CodePudding user response:
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.
CodePudding user response:
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