Jump to content


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

  • Please log in to reply
4 replies to this topic

#1 bilis_money

  • Members
  • PipPipPip
  • Advanced Member
  • 621 posts

Posted 21 August 2006 - 02:47 AM

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 -->

Warning: Cannot modify header information - headers already sent by (output started at...

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.

#2 High_-_Tek

  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts

Posted 21 August 2006 - 02:49 AM

Try using output buffering before your call to header() (ob_start(), etc)

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

#3 bilis_money

  • Members
  • PipPipPip
  • Advanced Member
  • 621 posts

Posted 21 August 2006 - 03:22 AM

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...

#4 tomfmason

  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 21 August 2006 - 03:23 AM

Do you echo something or have any html output before your header?

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux

#5 desithugg

  • Members
  • PipPipPip
  • Advanced Member
  • 281 posts
  • LocationScarborough

Posted 21 August 2006 - 04:06 AM

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

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users