rswyatt
06-08-2004, 02:40 PM
Alright, I have a rather lengthy form that I've decided to split into 7 sections (yup, it is lengthy). I don't want the form on 7 different pages, seems incoherent to me...
So, I've decided that through the brilliance of PHP I can simply include the whole form on one page, but using if's to echo out the current part of the page...
The following are the parts of the form that handle whether or not to echo out the current part of the form, I've left out form pieces for space... I guess the main question is... Just how many times can you post back to the same page? it seems to me that after two times... it just kind of pukes and goes bye bye..
//this is form part 1
<?
if (!isset($_POST['pg1']) && !isset($_POST['pg2']) && !isset($_POST['pg3']) && !isset($_POST['pg4']) && !isset($_POST['pg5']) && !isset($_POST['pg6']) && !isset($_POST['pg7'])){ ?>
//Now the form echos out and I have a hidden variable:
<form action = "<? echo $_SERVER['PHP_SELF; ?>" name="needsanalysisPg1" method="post">
<input type="hidden" name="pg1" value="1" />
//and now we submit
<? } ?>
//now we go to form part 2
<? if (isset($_POST['pg1']) && !isset($_POST['pg2']) && !isset($_POST['pg3']) && !isset($_POST['pg4']) && !isset($_POST['pg5']) && !isset($_POST['pg6']) && !isset($_POST['pg7'])){ ?>
//Now the form echos out and I have a hidden variable:
<form action = "<? echo $_SERVER['PHP_SELF; ?>" name="needsanalysisPg2" method="post">
<input type="hidden" name="pg2" value="1" />
<input type="hidden" name="pg1" value="1" />
//and now we submit
<? } ?>
//now we go to form part 3
<? if (isset($_POST['pg1']) && isset($_POST['pg2']) && !isset($_POST['pg3']) && !isset($_POST['pg4']) && !isset($_POST['pg5']) && !isset($_POST['pg6']) && !isset($_POST['pg7'])){ ?>
<form action = "<? echo $_SERVER['PHP_SELF; ?>" name="needsanalysisPg3" method="post">
and so on and so forth and on it goes until we get to part 7.
The problem is that once I've submitted part 1, submitting part 2 often(as I've changed and tweaked) goes back to part 1... sometimes it just goes blank... I can never seem to get past two submissions... any help?
So, I've decided that through the brilliance of PHP I can simply include the whole form on one page, but using if's to echo out the current part of the page...
The following are the parts of the form that handle whether or not to echo out the current part of the form, I've left out form pieces for space... I guess the main question is... Just how many times can you post back to the same page? it seems to me that after two times... it just kind of pukes and goes bye bye..
//this is form part 1
<?
if (!isset($_POST['pg1']) && !isset($_POST['pg2']) && !isset($_POST['pg3']) && !isset($_POST['pg4']) && !isset($_POST['pg5']) && !isset($_POST['pg6']) && !isset($_POST['pg7'])){ ?>
//Now the form echos out and I have a hidden variable:
<form action = "<? echo $_SERVER['PHP_SELF; ?>" name="needsanalysisPg1" method="post">
<input type="hidden" name="pg1" value="1" />
//and now we submit
<? } ?>
//now we go to form part 2
<? if (isset($_POST['pg1']) && !isset($_POST['pg2']) && !isset($_POST['pg3']) && !isset($_POST['pg4']) && !isset($_POST['pg5']) && !isset($_POST['pg6']) && !isset($_POST['pg7'])){ ?>
//Now the form echos out and I have a hidden variable:
<form action = "<? echo $_SERVER['PHP_SELF; ?>" name="needsanalysisPg2" method="post">
<input type="hidden" name="pg2" value="1" />
<input type="hidden" name="pg1" value="1" />
//and now we submit
<? } ?>
//now we go to form part 3
<? if (isset($_POST['pg1']) && isset($_POST['pg2']) && !isset($_POST['pg3']) && !isset($_POST['pg4']) && !isset($_POST['pg5']) && !isset($_POST['pg6']) && !isset($_POST['pg7'])){ ?>
<form action = "<? echo $_SERVER['PHP_SELF; ?>" name="needsanalysisPg3" method="post">
and so on and so forth and on it goes until we get to part 7.
The problem is that once I've submitted part 1, submitting part 2 often(as I've changed and tweaked) goes back to part 1... sometimes it just goes blank... I can never seem to get past two submissions... any help?