I have this code on page.php
<?php
if(array_key_exists('form', $_POST)) {
$name = $_POST['name'];
echo $name;
} else {
?>
<form action="" method="post">
<p>Name<br />
<input name="name" type="text"></p>
<input name="form" type="hidden" />
</form>
<?php } ?>
But when the page is submitted it returns a 404 error, despite the URL being identical between pages. I understand this must have something to do with WordPress querying the page but does any have any idea to get this to work?