Page 1 of 1

header() is the only way to forward/switch to other page ?

PostPosted: 03. July 2007 10:01
by w3irdo
is header() is the only way to forward/switch to other page ?

i am placing it at the very bottom of my php page, after all my "echo" etc.
I have no choice.

Is there any other method ?

PostPosted: 03. July 2007 10:48
by johnd
im guessing your talking about php right?

if so you need to declare headers before browser output

PostPosted: 03. July 2007 11:12
by w3irdo
yeah.

but is tat the only way?

i have no choice but to put at the bottom.

Is header() the only method that can be used in php ?

PostPosted: 03. July 2007 12:04
by Wiedmann
i have no choice but to put at the bottom.

Why?

i am placing it at the very bottom of my php page, after all my "echo" etc.

It makes really no sense to make a lot of output with echo() and the redirect the user, because the user don't see your echo's.

I think you should redesign your code...

Re: header() is the only way to forward/switch to other page

PostPosted: 09. July 2007 10:55
by ldivinag
w3irdo wrote:is header() is the only way to forward/switch to other page ?

i am placing it at the very bottom of my php page, after all my "echo" etc.
I have no choice.

Is there any other method ?


what did you have in mind?

automatically switching pages without the user's actions?

or just provide links at the bottom?

HEADER() is a very finicky function. even as small as a "space" has been sent from the server to the client, your php script will fail immediately with the infamous error message...