All,
dealing with header("location:...") again.  and trying to understand what's
happening.

I've got the following code:

writeMessage($id);
header("Location:http://www.mysite.com/cp/ad/ad_details.php?id=";. $id);

writeMessage() is a debugging function that writes the value of the variable
to a debug log.  When the code is run $id does have a valid value like 8 or
12.

When I run the code, it does not redirect to the specified location, it
continues executing the code.

So I add the exit; and it does work:

writeMessage($id);
header("Location:http://www.mysite.com/cp/ad/ad_details.php?id=";. $id);
exit;

What's weird is the same code without the exit works on a different server
(and indeed the same code with different location works on this server)

I thought perhaps it was due to type problem, but code doesn't work if $id
is a string or integer.

The flow for the code:
start the edit page
when edit page is submitted,
check the data,
if data is good,
        update the database
        redirect to details page
if data is bad,
        return to the edit page

Then I used LiveHTTPHeaders in Mozilla and it give me some interesting
information, though I'm not quite sure how to interpret.

Can someone provide some depth to the mechanisms within the
header(location)?

Thanks in advance,

Chris Hubbard
[EMAIL PROTECTED]
www.wildcharacters.com
425 481 2020

php based web application development

[[ check out phalidate, a data validation class ]]

Y! [EMAIL PROTECTED]
MSN [EMAIL PROTECTED]
AIM ganeshacph

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

Reply via email to