According to RFC 2616 (Section 4.2):
The order in which header fields with differing field names are
received is not significant. However, it is "good practice" to send
general-header fields first, followed by request-header or response-
header fields, and ending with the entity-header fields.
You have to think a little different if you're a developer and have to deal with an issue like this. This style of coding needs to be determine at the BEGINNING OF DEVELOPMENT. Many people love to code PHP
so they can switch in and out of HTML
. At the point HTML
(even a whitespace) or PHP
has an echo
or print
statement header
s are closed (not the HTML headers, but the headers that tell the browser what is coming, an image, an HTML page, a redirect, etc.).
Typical PHP code by home-grown developers:
<h2>Welcome <?php echo $Username; ?></h2>
<p> We were considering your application(s) for <?php echo $specialty; ?>.
We are <?php
if($accepted==1){
echo "happy"
} else {
echo "sorry"
}
?> to inform you of our decision ...
A better, more flexible way
The way around this is to store everything serverside until completely done processing, THEN check for errors and post a response. A better method is:
/*$page string started out here somewhere*/
if(empty($request_id)){
//code for the 404
} elseif ($request_id < 0)
//code for the 410
} else {
switch($accepted){
case "1":
$mood = "happy";
break;
default:
$mood = "sorry";
$inner_code = "<h2>Welcome $Username</h2>\n";
$inner_code .= "<p>We were considering your application(s) for $specialty.";
$inner_code .= " We are $mood to inform you of our decision ...";
/*more stuff here*/
$page .= $HTML_header;
$page.=$inner_code;
$page .= $HTML_footer;
print $page;
}
In your specific case
It sounds as though a lot of development has been done. If the site has a bit of size or complexity, this can cause an issue in budgeting (if you're using contractors). If the programmers are in-house though, you should be able to rewrite the site without issue (at least this part of it).