You have created HTML forms and then processed the data in a separate PHP page.  It is more elegant to do that on one page by adding an if statement:

if the form has not been submitted

display it

otherwise

process the data