On Sat, 11 May 2002, baldey_uk wrote:
> 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">&nbsp;<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.'>';
>               header("Location: updateaddress.php");
>               exit;
>               }
> ?>

You want to use include() instead of header() here. Change 
updateaddress.php so it doesn't output <HTML><HEAD> etc if it's being 
included from another file (use a global or whatever).

header() can't be used after other output has been sent. And 
header(Location:) doesn't make any sense after other output has been sent, 
because it tells the browser that you didn't want this page, you want some
other page INSTEAD. Instead means that everything on this page should 
never have happened. And that's not what you're doing here, because you 
are generating useful output on this page.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to