I have two .php files as such:
test1.php
Sample
You simply need to remove the action="test2.php" section and combine both pages into one just like the following:
Sample Please enter a number