Hi
I have a PHP page with a number of dropdowns on it and a submit button. When a value is chosen from a dropdown I need the page to refresh (a total is calculated). However when the submit button is pressed I need to go to another page which uses the values from the first page. I have tried to do this as follows:
if (isset ($_POST['Submit']) ) {
echo '<form name="form1" method="post" action="form2.php">';
}
else {
echo '<form name="form1" method="post" action="form1.php">';
}
?>
However this only partially works as the following problems occur:
1. The first time you hit the submit button form1 refreshes - if however you hit submit a second time then form2 opens as it it supposed to.
2. If you go back from form2 to form1, form2 is then always opened regardless of whether you hit submit or choose a value from the dropdowns.
Where are my going wrong??
Many thanks
Ken
I have a PHP page with a number of dropdowns on it and a submit button. When a value is chosen from a dropdown I need the page to refresh (a total is calculated). However when the submit button is pressed I need to go to another page which uses the values from the first page. I have tried to do this as follows:
if (isset ($_POST['Submit']) ) {
echo '<form name="form1" method="post" action="form2.php">';
}
else {
echo '<form name="form1" method="post" action="form1.php">';
}
?>
However this only partially works as the following problems occur:
1. The first time you hit the submit button form1 refreshes - if however you hit submit a second time then form2 opens as it it supposed to.
2. If you go back from form2 to form1, form2 is then always opened regardless of whether you hit submit or choose a value from the dropdowns.
Where are my going wrong??
Many thanks
Ken