From: Stephen L. Jr. <sla...@uc...> - 2002-07-15 20:32:43
|
Hey all, I have been asked by a user to incorporate a previous button into phpesp for multi-page surveys. So, here it is. Can you guys take a peek at this, or maybe try it out, and make sure it is done properly. Maybe there is a better way? * Displays "Next" only when first page is viewd * Displays "Previous" and "Next" when middle pages are viewed * Displays "Previous" and "Submit" when last page is viewed $ diff public/handler.php ../../phpESP_cvs/public/handler.php 82,89d81 < // Previous button start < if(!empty($HTTP_POST_VARS['previous'])) { < $msg = response_check_required($sid,$HTTP_POST_VARS['sec']); < if(empty($msg)) { < $HTTP_POST_VARS['rid'] = response_insert($sid,$HTTP_POST_VARS['sec'],$HTTP_POST_VARS['rid']); < $HTTP_POST_VARS['sec']--; < } < } 103d94 < <input type="submit" name="previous" value="Previous Page"> 105,106d95 < <?php } elseif ($HTTP_POST_VARS['sec'] == 1) { ?> < <input type="submit" name="next" value="Next Page"> 108d96 < <input type="submit" name="previous" value="Previous Page"> -- Stephen Lawrence Jr. - Programmer sla...@uc... California Animal Health & Food Safety Laboratory System, UC Davis (530)-752-4614 |