I have a web page in php. I put two buttons in the form on the page. Now the problem is that I want to navigate into different pages , but i cant. The buttons are say submit and back. if I pressed submit i want to go to reg.php or if I pressed back, i want to goto home.php. How can i do this?
How I can navigate to different pages from a single page using different buttons?
Collapse
X
-
-
If these buttons are related to a form, the submit button should just be a regular submit button and the back button (which I personally call a "cancel" button) should be an anchor.
If the action attribute of your form element is "reg.php", then hitting submit will send your user to reg.php. If the href attribute of your anchor element is "home.php", clicking it will send your user to home.php.
But like I said, the cancel button shouldn't be a button. Don't send a button in to do a link's job.Comment
Comment