ozestretch Posted September 21, 2009 Share Posted September 21, 2009 What are the issues with setting up something like this? page1.php <?php header('Location: http://www.phpfreaks.com/'); // meta refresh, html link down here as backup ?> page2.php <?php header('Location: page1.php'); // meta refresh, html link down here as backup ?> I realise that by itself seems usless. But what if page1.php is on a different domain, that happens to be a redirect page and I only control the page2.php Scenario: URL mask(shortner) script I have on site A uses header('Location: ....') plus a backup of meta refresh and an actual link just incase But a URL gets shortened that is redirected similarly I get a header output message for a moment when I do this, but meta kicks in and takes it to 'http://www.phpfreaks.com/' anyways Quote Link to comment Share on other sites More sharing options...
rhodesa Posted September 21, 2009 Share Posted September 21, 2009 no problems...it will keep following the redirects Quote Link to comment Share on other sites More sharing options...
ozestretch Posted September 22, 2009 Author Share Posted September 22, 2009 After looking again, I can't see why the whitespace/header already outputted error persists in this situation except I just went to get the code, and that HDD is not plugged in (just spent last 5 hours fixing a MBR / NTLDR error) well spent 30 minutes fixing, 4 1/2 hours working out the what / why and how's :'( In my code above, should that cause header already outputted notice? (my actual code in page2.php contains more than that header redirect but I can't see how that causes the error when at page1.php) but when testing with redirecting to page1.php (like I have above) it outputs notice. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted September 22, 2009 Share Posted September 22, 2009 you can't output anything before using header(). what is the rest of the code for page2.php? Quote Link to comment Share on other sites More sharing options...
ozestretch Posted September 23, 2009 Author Share Posted September 23, 2009 you can't output anything before using header(). what is the rest of the code for page2.php? Mysql query(or queries - can't remember), but no output. (once my main pc is working again, I can access the code) Was my understanding that if there was output before header, the redirect would not work? If that is the case, def no output as it does redirect. (works a charm if page2.php location = http://www.phpfreaks.com [or a page that is not causing a header redirect]) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.