WordPress.org

Ready to get started?Download WordPress

Forums

conflict with get_header(), php header function and Internet Explorer (5 posts)

  1. george@piccexcellence.com
    Member
    Posted 1 year ago #

    I use header("Location: xxxxxxxxx"); to move around internally to various php files. I have a conflict with get_header() that I've worked around, mainly by not having header() and get_header() in the same file together. This works with all browsers EXCEPT, yep you guessed it, IE. I have to put the get_header() function after some include calls (which contains the header() function), else I get a blank screen. In IE, it's as if the get_header() function doesn't implement at all, I get no styles from my css file hence the page is wacked out. If I move the get_header() function above the includes, no problem, except the include files and their functions no longer work. what a mess.

    Any thoughts or clues to making things work with IE would be appreciated.

    George

  2. george@piccexcellence.com
    Member
    Posted 1 year ago #

    Okay, further research reveals that php header() function has to come first before any hmtl code. Each wordpress page begins with wordpress function - get_header, which obviously loads the header information (html) for each page. So I move the get_header() function below any include files and the php header() function works fine EXCEPT in Internet Explorer (v9). Everything gets screwed up with formatting if I don't put the get_header() function as the first item called on a php page, just in IE, all other browsers are fine.

    Any thoughts on this would be appreciated. Are there compatibility codes that can be put in the header.php file that would correct for this?

    George

  3. Andrew Bartel
    Member
    Posted 1 year ago #

    Try using wp_redirect rather than the built in php function.

    Edit: Remember, WordPress is a template driven system, rather than a single static/dynamic page. The urls are just a command to the system rather than a file call.

  4. george@piccexcellence.com
    Member
    Posted 1 year ago #

    Thanks Andrew, that redirect works however it still has the same problem of html output disabling the redirect. I found through further reading that turning on the output buffer (ob_start()) in my header.php file allows it to work with php 4.4 and newer and IE. Looks like other browsers must turn on the output buffer automatically, that's my guess anyway, cause IE is the only browser that has a problem...

    Thanks again...

    George

  5. Andrew Bartel
    Member
    Posted 1 year ago #

    php 4.4 o0? Time to upgrade!

Topic Closed

This topic has been closed to new replies.

About this Topic