I have a form on my web page (index.php) where a user can choose to answer a series of questions using radio buttons. When the user clicks the 'submit' button associated with the form, the user's answers are stored on a page called 'save_results.php' using session variables. Another page called 'show_results.php' shows the user's answers by printing the session variables from 'save_results.php'. Everything works well as far as the answers being stored.
One problem I have is that the when the submit button is clicked, the blank page 'save_results.php' is shown. I am only using this page to store the answers so there is nothing on it. Is there a way that the answers can be stored on 'save_results.php' when the user clicks submit without navigating away from the 'index.php' page.
Here is an example of the index.php page
index.php:
<form action="save_results.php" method="post">
<label for="male">Male</label>
<input type="radio" name="sex" value="male" />
<br />
<label for="female">Female</label>
<input type="radio" name="sex" value="female" />
</form>
<button type="submit" id="add_button" title="Remember this result">Store</button>
<p><a href="show_results.php">Show overall results</a></p>