Jump to content

header (location:) within <html>?


melting_dog

Recommended Posts

Hi,

 

I have an include function that has all my header tags (<head>, html document type, css link, <html>, etc)

 

But I want to redirect my to another page later on in my code (in an 'if' statement).

 

I realise that you cannot use header(location:####) within the html tags. Is there another way to redirect?

 

Cheers.

Link to comment
https://forums.phpfreaks.com/topic/207467-header-location-within/
Share on other sites

Do all the checks that might result in a redirect before you include the HTML. It doesn't make any sense to redirect after you started to output a web page.

 

The other ways of doing a redirect is with a META tag or via Javascript.

 

Ken

Archived

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

×
×
  • Create New...

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.