On Saturday 11 May 2002 19:20, baldey_uk wrote: > Here ya go: > > Basically im trying to update details in a database, after the new details > are put into a form they are printed to the screen with a 'are the details > correct' scenario. From there if they click 'no' i want them to be put back > to the updateaddress.php page but also pass two php variables back to that > page for use later on. If they say yes i will do mysql query calls and > update the database but also need to forward them to another php page and > pass varaible values to that new page > <? > > echo '<form method="post"><input type="submit" name="choice" > value="yes"> <input type="submit" name="choice" value="no"></form> '; > switch($_POST['choice']) > { > case "yes" : > #somethin will happen here ; > break; > > #if not we need to keep the customer_id and quantity and start again > case "no" : > echo '<INPUT type="hidden" name="txtJars" value='.$quantity.'><INPUT > type="hidden" name="txtCustomer_id" value='.$customer_id.'>';
No point having the above echo()s ... > header("Location: updateaddress.php"); ... if you use a header() you cannot output anything beforehand. See manual. You need to change the flow of your script so that it makes the decisions then output or redirect as necessary. To pass the variables back to the updateaddress.php page do: header("Location: updateaddress.php?txtJars=$quantity&txtCustomer_id=$customer_id"); if $quantity and $customer_id contain some funny chars you should run it through urlencode(). -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* QOTD: "I am not sure what this is, but an 'F' would only dignify it." */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php