dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Headers.. whose on first?

  1. #1
    Join Date
    Dec 2002
    Location
    Asia by the medetarenean shore
    Posts
    26

    Headers.. whose on first?

    In my update file I have the following code (it is a PHP file):


    function do_redirect ( $url )
    {
    Header ( "Location: $url" );
    exit;
    }



    echo"
    <script>
    parent.treeframe.window.location.reload()
    </script>";

    do_redirect ("ListInventoryItem.php");

    I get error of "Already Sent Headers" - from the reload statement.

    How can I do a reload and then do a redirect?

    Thanks,

    -Alon.

  2. #2
    Join Date
    Feb 2003
    Location
    Britain
    Posts
    1,335
    You can't send new headers once any information has been sent to the browser. This means that their can have been no HTML before the header code, only PHP. Also, the PHP must not use any echo or print statements.

  3. #3
    Join Date
    Dec 2002
    Location
    Asia by the medetarenean shore
    Posts
    26
    Thanks, that became clear now.

    -Alon.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles