hi
i use php5, sometimes i see that
header(location:index.php);
takes me to a blank page, i have never experienced that in linux.
no matter what the code before the header contains, it just takes me to a blank page.
if i put javascript location.href with the same path it works fine (not such a good idea).
system info:
Windows NT SERVER9 5.0 build 2195 .
PHP Version 5.1.2

Thanks

    This sounds like a common problem faced by a lot of people. Here is my guess:

    In your php.ini file, you have the display errors directive set to "no". In your PHP script, if you try to send headers after you have already echo'd or print'd anything to the browser, PHP will raise an error. However, if you have display errors off, then you will get a blank screen (the script will halt because there is an error, but it won't display it).

    Check that you are not sending headers after you send output to the browser.

      WDPEjoe's advice sounds good: putting a ini_set('display_errors', 1); at the start (or at least before your header() call) may give you some info.

      Also, to be HTTP 1.1 compliant, you need a fully qualified URI for the location:

      // always correct:
      header("Location: http://www.yoursite.com/directory/page.php");
      
      // may not work in some situations:
      header("Location: page.php");
      
        WDPEjoe wrote:

        This sounds like a common problem faced by a lot of people. Here is my guess:

        In your php.ini file, you have the display errors directive set to "no". In your PHP script, if you try to send headers after you have already echo'd or print'd anything to the browser, PHP will raise an error. However, if you have display errors off, then you will get a blank screen (the script will halt because there is an error, but it won't display it).

        Check that you are not sending headers after you send output to the browser.

        sorry i didnt reply, it was a holiday in my country.
        anyway, doesnt ob_start after the session_start suppouse to salve that?
        because it doesnt.
        Thanks

          No, ob_start() solves that only if it's used before any code that produces output to be sent to the browser.

            Write a Reply...