Justtechjobs.com Find a programming school near you






Online Campus Both


php-developer-list | 2001122

Re: [PHP-DEV] Re: Bug #14653 Updated: Internet Explorer for Macintosh receives bad HTTP header info from PHP Header() From: Fred B (fredb86 <email protected>)
Date: 12/23/01

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

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>