Click to See Complete Forum and Search --> : redirection query


damon2003
12-17-2003, 05:49 AM
hi,
I have a question about PHP redirection. I have a cancel button on my page. When pressed I want to run a script that will unregister some sessions and then redirect to a specific page.
I thought about this:

session_unregister('completeCustOrders');

header(location: http://)

the problem is doesnt the header(location: http://) has to be right at the top of the page. Are there any other ways to redirec to a page

pyro
12-17-2003, 10:14 AM
No, that is the only way. I don't see the problem, though. Why not just put this at the top of the page?

damon2003
12-17-2003, 10:19 AM
Hi,
at first I though that nothing at all could be placed above the header.
So its just HTML that cant be placed above the header?

pyro
12-17-2003, 10:21 AM
Correct. As long no output has been sent to the browser, it will be fine.