guess this is because I have already output html before this php command

Exactly right. Why don't you use the header() function at the top of the page before sending any other headers? It will definitely work that way. And if the problem is because you're doing some evaluation down in your page, take that evaluation out and bring it up above the headers, as well. I usually do all my page processing and evaluation at the top of my pages before I write any HTML.


As for the meta redirect, I'm not sure of any problems there (others will likely know better than I), but I think it's best to have your application do the redirect from the server-side rather than the client-side. If your evaluation is high enough in the page to know to print the meta redirect tag, then you can probably afford to move it just a few lines higher than the <html> tag and use header() instead. Doing things on the server-side is always best and more secure; end-users are less likely to be able to screw things up.

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to