I have this registration form. How can I send the input information to the action.php without redirecting the user to it and after that redirecting it back to this page. I want the form to be submitted in the background.
<p id="message"></p>
<form action='action.php' method='post'>
Username: <input type='text' name='username'>
Password: <input type='password' name='password'>
e-mail: <input type='text' name='email'></div>
<input type='submit' value='Register' onclick='Submit()' />
</form>
<script>
function Submit(){
document.getElementById("message").innerHTML = "You have been successfully registered";
}
</script>
Thanks!