PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
calls on a website of mine and everything's working well.
Now a user contacted me to say that the redirections aren't working. I'm not sure if it's got anything to do with the "header("Location: $url");" code yet, but I think I'd ask the Forum members anyway if there are any known incompatibilities with this method of redirection?
I've tested it in most browsers without problems.
The header function sends a response to the client, and it's up to the client (i.e. browser) to determine what to do with that directive. Just like if the PHP script echoed a response, for all we know the browser might interpret that to mean "crash now".
Headers are kind of tricky that way. I suggest, under your header function, you echo a link to the intended destination.
Not quite. The header function is like anything other php function, it just tells the server to send the information from a different page instead of the original. The browser has nothing to do with it.
The problem is with your code/input, not the browser.
LiLpunkSkateR wrote:Not quite. The header function is like anything other php function, it just tells the server to send the information from a different page instead of the original. The browser has nothing to do with it.
The problem is with your code/input, not the browser.
Incorrect. Try using cURL sometime on a page that uses a location header. Its up to the browser to get the new page. Some browsers have trouble if you dont use an absolute url, so make sure if you're dynamicly making urls to put $_SERVER['HTTP_HOST'] before the relative location