I want to go to different templates(page) whatever is selected(radio button) from a single form. I want to include just one button in my form.
Here as if someone selects template1
I will to page template1.php.
If I select template2
I will go to template2.php.
I have saved the below code as form.php
<form method="POST" action=
"<?php if(($rb = $_POST('template'))=='1'){?>
template1.php
<?php }
if(($rb = $_POST('template'))=='2'){?>
template2.php
<?php } ?>"
enctype="multipart/form-data">
<label>First Name: </label>
<input type="text" name="firstname">
<label>Last Name: </label>
<input type="text" name="lastname">
<input type="radio" value="1" name="template">Template 1
<input type="radio" value="2" name="template">Template 2
<button type="submit" name="upload">POST</button>
</form>