I have a main phtml script and I want to be able to run another phtml script when a user clicks the submit button within the main script.(This is all being done using php and html) Currently this is how I'm doing it.
<input id="submit" type="submit" name="submit" value="Submit" onclick="self.location.href='another.phtml'"/>
When I run this, it will load the page but it won't actually execute anything in the script. And I do know it works because I am able to execute it successfully when calling it using:
<a href="another.phtml">Click Here</a>
I've also tried creating an additional php script, and using include to include the additional phtml file, and then call it with the same method above.
I've also tried to use javascript (See example: How do I run PHP code when a user clicks on a link?)
Is there another way I can do this?
Thank you for your time