problems posting twice to same page using PHP_SELF… is this possible?

mlevel

New Member
im having a problem with php yet again... i've created a page with multiple forms on it and when i test it i've learnt that the first form is processed (with the ongoing, complete and reject) values but then i cant seem to process the 2nd form the same way. what could be the matter?any help would be appreciated... happy new year to all the users of the site!\[code\] <? if (array_key_exists('complete',$_POST)) { echo "Sucess!"; exit; }; ?> <?php $days = range (01, 31); $months = range (1, 12); $y1 = date("Y")-2; $y2 = date("Y"); $years = range ($y1, $y2); if (array_key_exists('caseStatus',$_POST)) { $case = $_POST['case']; if ($case == 'complete') { echo 'Please set the date on which the case was <b>completed</b>.<p>'; echo "<form action='" . $_SERVER['PHP_SELF'] . "' method='post'>"; echo '<select name="completeDay">'; foreach (range(1, 31) as $day) { echo '<option value="'.sprintf("%02d", $day).'">'.sprintf("%02d", $day).'</option>'; } echo '</select>'; echo '<select name="completeMon">'; foreach (range(1, 12) as $month) { echo '<option value="'.sprintf("%02d", $month).'">'.sprintf("%02d", $month).'</option>'; } echo '</select>'; echo '<select name="completeYr">'; foreach ($years as $value) { echo '<option value="'.$value.'">'.$value.'</option>'; } echo '</select> <p> <input type="hidden" name="complete" value="http://stackoverflow.com/questions/1999907/1"/> <input name="submit" type="submit" value="http://stackoverflow.com/questions/1999907/Save"/> <input type="button" value="http://stackoverflow.com/questions/1999907/Cancel" onclick="window.location=\'\'"/> </form> '; exit; } <form method="POST" action="<?php echo $_SERVER['PHP_SELF'] . '?id=' . intval($client_id); ?>"> <select name="case" class="rta"> <option value="http://stackoverflow.com/questions/1999907/<?php echo $row_caseStatus['progress']; ?>" selected="selected"><?php echo $row_caseStatus['progress']; ?></option> <option value=""></option> <option value="http://stackoverflow.com/questions/1999907/ongoing">ongoing</option> <option value="http://stackoverflow.com/questions/1999907/complete">complete</option> <option value="http://stackoverflow.com/questions/1999907/reject">reject</option> </select> <input type="submit" name="caseStatus" id="caseStatus" value="http://stackoverflow.com/questions/1999907/Save" /> <input type="hidden" name="caseStatus" value="http://stackoverflow.com/questions/1999907/1"/> <br /> </form>\[/code\]
 
Back
Top