|
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>Register</title> |
|
<link rel="stylesheet" type="text/css" href="/static/style.css"> |
|
|
|
</head> |
|
|
|
<body> |
|
<div class="main-content"> |
|
<div class="color-overlay"></div> |
|
<footer> |
|
|
|
<p>Copyright © Your Website</p> |
|
</footer> |
|
<h1>Register</h1> |
|
<form action="/register" method="post" id="registration-form"> |
|
<label for="username">Username:</label> |
|
<input type="text" id="username" name="username" required><br><br> |
|
|
|
<label for="email">Email:</label> |
|
<input type="email" id="email" name="email" required><br><br> |
|
|
|
<label for="password">Password:</label> |
|
<input type="password" id="password" name="password" required><br><br> |
|
|
|
<label for="confirm_password">Confirm Password:</label> |
|
<input type="password" id="confirm_password" name="confirm_password" required><br><br> |
|
|
|
|
|
<input type="hidden" id="recaptcha_token" name="recaptcha_token" value=""> |
|
|
|
|
|
<div class="g-recaptcha" |
|
data-sitekey="6LdMjQcpAAAAAGtbNZkL17ry1scsQjp1HSEhkLNl" |
|
data-callback="onSubmit" > |
|
</div> |
|
<br/> |
|
|
|
<button type="submit">Register</button> |
|
|
|
</form> |
|
<script src="https://www.google.com/recaptcha/api.js" async defer></script> |
|
<script> |
|
|
|
|
|
function validateForm() { |
|
|
|
|
|
return true; |
|
} |
|
|
|
|
|
document.getElementById('registration-form').addEventListener('submit', function(event) { |
|
event.preventDefault(); |
|
|
|
var username = document.getElementById('username').value; |
|
var email = document.getElementById('email').value; |
|
var password = document.getElementById('password').value; |
|
var confirmPassword = document.getElementById('confirm_password').value; |
|
|
|
|
|
if(username && email && password && confirmPassword) { |
|
|
|
grecaptcha.execute(); |
|
} else { |
|
|
|
alert("Please fill in all required fields."); |
|
} |
|
}); |
|
|
|
|
|
function onSubmit(token) { |
|
document.getElementById('recaptcha_token').value = token; |
|
document.getElementById('registration-form').submit(); |
|
} |
|
|
|
|
|
grecaptcha.ready(function() { |
|
|
|
}); |
|
</script> |
|
|
|
</div> |
|
</body> |
|
|
|
</html> |
|
|