[FX.php List] One Button, two forms/scripts?

Steve Winter steve at bluecrocodile.co.nz
Fri Oct 7 00:09:46 MDT 2005


Johnathan,

Quick and dirty fix, copy the block of php code from the top of
edit_response.php which does the updating of the database and paste it
into the head of approve.php, that way, any changes which they have made
since last hitting 'Refresh' will be logged back into the db...(another
reason why the  single file concept is nice and neat ;-)

Cheers
Steve


-----Original Message-----
From: Jonathan Schwartz <jonathan at eschwartz.com>
To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
Date: Thu, 6 Oct 2005 18:13:06 -0700
Subject: [FX.php List] One Button, two forms/scripts?

> Hello.
> 
> I have an edit page (edit.php) where users fill in a form, click a 
> refresh button which loads edit_response.php to save the data, 
> leaving the user on the original edit page to continue editing.  When 
> they want to leave, they click a separate button (continue), which 
> delivers them to a thank you page. No processing...just display of 
> data.
> 
> The problem....users who edit and click continue (skipping the step 
> which saves the data on edit_response, lose their data.  I have tried 
> to use a warning note, asking users to click refresh button before 
> leaving...but that fails the ultimate test...the Melanie test. 
> Melanie is my wife. ;-)
> 
> To the question.  How do I have the Continue button run the 
> edit_response script before heading to the Thank you exit screen.  I 
> would still kep the Refresh button.
> 
> Here is the code for the two buttons:
> 
> <form method="post" action="edit_response.php">
> <input type="hidden" name="recid" value="<?php echo $recid; ?>">
> <input type="image" name="refresh"  src="images/refresh.gif">
> </form>
> 
> 
> The Thank you/Exit button:
> 
> <form method="post" action="approve.php">
>    <input type="hidden" name="recid" value="<?php echo $recid; ?>" />
>    <input type="image" name="approve" border="0" 
> src="images/buttoncontinue.gif">
> </form>
> 
> Thanks!
> 
> Jonathan
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list




More information about the FX.php_List mailing list