bilis_money Posted August 21, 2006 Share Posted August 21, 2006 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. Link to comment https://forums.phpfreaks.com/topic/18156-redirecting-page-without-using-header-is-there-another-way/ Share on other sites More sharing options...
High_-_Tek Posted August 21, 2006 Share Posted August 21, 2006 Try using output buffering before your call to header() (ob_start(), etc)You can use JS Redirects (non-reliant) and META redirects (same) Link to comment https://forums.phpfreaks.com/topic/18156-redirecting-page-without-using-header-is-there-another-way/#findComment-77851 Share on other sites More sharing options...
bilis_money Posted August 21, 2006 Author Share Posted August 21, 2006 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... Link to comment https://forums.phpfreaks.com/topic/18156-redirecting-page-without-using-header-is-there-another-way/#findComment-77862 Share on other sites More sharing options...
tomfmason Posted August 21, 2006 Share Posted August 21, 2006 Do you echo something or have any html output before your header? Link to comment https://forums.phpfreaks.com/topic/18156-redirecting-page-without-using-header-is-there-another-way/#findComment-77863 Share on other sites More sharing options...
desithugg Posted August 21, 2006 Share Posted August 21, 2006 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 Link to comment https://forums.phpfreaks.com/topic/18156-redirecting-page-without-using-header-is-there-another-way/#findComment-77876 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.