Here is the code I am using for the log in page in my site. Basically what I'm asking is, with the code below, how can I make a compatible form/database/anything in a different document to store the usernames and passwords that people enter on a separate sign up page? And how would I link it into my javascript/html log in pages if I need to? Also are there any changes I definitely need to make to the code (disregarding the coruser and corpass values- those are placeholders). Sorry for all the questions. Thank you!
HTML CODE (only including the relevant parts):
<h1>Log In</h1>
<form action="action_page.php">
Username:<br>
<input type="text" name="username" id="userInput"> <br>
Password:<br>
<input type="text" name="password" id="password"> <br><br>
<input type="button" value="log in" onClick="logIn(username)"> </button>
</form>
JAVASCRIPT CODE
var logIn = function (logInFunction){
var user = document.getElementsByName("username")[0].value;
var password = document.getElementsByName("password")[0].value;
var coruser = "username123"
var corpass = "password123"
if (user === coruser) {
if (password === corpass) {
window.alert("Logging in... Please wait");
}
else {
window.alert("incorrect password");
}
}
else {
window.alert("incorrect username")
}
}