Re: Re: Bug #14653 Updated: Internet Explorer for Macintosh receives bad HTTP header info from PHP Header()
| From: | Fred B | Date: | Sun, 23 Dec 2001 07:25:28 +0000 |
| Subject: | Re: Re: Bug #14653 Updated: Internet Explorer for Macintosh receives bad HTTP header info from PHP Header() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-74845@lists.php.net to get a copy of this message | ||
Is the PHP Header() function defined in
the file servlet.java that's part of the
PHP source code? The routine is listed below.
If so, it would appear that PHP is depending
on a Java servlet for the actual file redirection.
FB
public void header(String data) {
// try to send the header using the most specific servlet API
// as possible (some servlet engines will add a content type
// header unless the setContentType method is called).
try {
if (data.startsWith("Content-type: ")) {
response.setContentType(data.substring(data.indexOf(" ")+1));
} else if (data.startsWith("Location: ")) {
response.sendRedirect(data.substring(data.indexOf(" ")+1));
} else {
int colon = data.indexOf(": ");
if (colon > 0) {
try {
addHeader.invoke(response, new Object[]
{ data.substring(0,colon), data.substring(colon+2) } );
} catch (Exception e) {
e.printStackTrace(System.err);
}
} else {
write(data);
}
}
} catch (IOException e) {
e.printStackTrace(System.err);
}
}
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com