Firefox PHP

header() vs conditional includes

Posted by kksuck2 
header() vs conditional includes
October 27, 2003 06:25PM
header() calls vs conditional includes: what's the reasoning behind it in phorum's source?

Why does the phorum code tend to use this methodology:

if([some condition]){
header("Location: [phorum hompage]");
exit;
}

instead of this:

if([some condition]){
include("[phorum hompage]");
return;
}

I'm primarily refrencing phorum 3, but I've seen it in phorum 5's source as well. Is there some logic behind the header() calls that I'm missing?
Re: header() vs conditional includes
October 28, 2003 09:50AM
1) including other main files in main files is bad because each file operates off of the QUERY_STRING of the url that was requested. A POST request to post.php has no QUERY_STRING and therefore other pages would not even work in that case. It is best to have each page operate in the environment it is meant to be in.

2) Would it not be quite confusing to see: read.php in your address bar but have a page that lists the messages?

3) that is just bad coding IMHO.
Sorry, only registered users may post in this forum.

Click here to login