melting_dog Posted July 12, 2010 Share Posted July 12, 2010 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 More sharing options...
kenrbnsn Posted July 12, 2010 Share Posted July 12, 2010 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 Link to comment https://forums.phpfreaks.com/topic/207467-header-location-within/#findComment-1084678 Share on other sites More sharing options...
melting_dog Posted July 12, 2010 Author Share Posted July 12, 2010 hmm, ill have to check out the javascript way or not use include on this page. Cheers for the info! Link to comment https://forums.phpfreaks.com/topic/207467-header-location-within/#findComment-1084696 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.