Jump to content

Archived

This topic is now archived and is closed to further replies.

bilis_money

redirecting page without using HEADER(), is there another way?

Recommended Posts

i want to know or is there any other way to redirect a page without using a header().

I'm sick using header() it is not very flexible, i'm using header() in the middle of my codes and it always trew me a message error -->
[quote]Warning: Cannot modify header information - headers already sent by (output started at...[/quote]

yes, i know about the cause of this error it has white spaces and this should be put at the first and no white spaces before the header()...

any help from you guys is very appreciated thanks in advance.

Share this post


Link to post
Share on other sites
Try using output buffering before your call to header() (ob_start(), etc)

You can use JS Redirects (non-reliant) and META redirects (same)

Share this post


Link to post
Share on other sites
hi High-Tek,

Do i need to call ob_clean() first before header(),
i tested it and it doesn't work, sorry but i'm new to this ob_* thing.
please can you show me a snippet codes to do this with the header().

thanks in advance.

-i'm confuse, i dunno which is the right one to use...

Share this post


Link to post
Share on other sites
Do you echo something or have any html output before your header?

Share this post


Link to post
Share on other sites
yea if you echo something ow have something before the header it will not redirect so if ur using include a page before the header redirevt and that page echos some stuff it will not work

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.