special browser cannot display page ...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laurent Compere

    special browser cannot display page ...

    Hi,

    I'm trying to do something I thought easy. Explanation : I've recently
    bought a Multimedia Player DVX-500E. This player is connected via ethernet
    on my local network et allows among other things to browse web pages (not
    everyone).
    I don't know anything about this browser nor about media server implentation
    (on the pc side).
    I want to browse a page with Tv schedule (a simplified version of
    EuroTV.com). To do that, I've created a php page :

    <?

    $sFile =
    file_get_conten ts("http://www.eurotv.com/scripts/Nowoutprint.cfm ?Language=fr&Av ailableIn=Belgi um&TypeAll=true &DisplaySummary =YES");
    $sFile = utf8_decode($sF ile);
    $sFile = ltrim($sFile);
    $sFile = preg_replace ("/>\n</", " ", $sFile);
    $sFile = preg_replace ("/>\s\s+</", "><", $sFile);

    echo $sFile;
    ?>

    This page cannot be displayed in the browser, however it displays correctly
    under IE, Mozilla, Netscape.
    Nothing surprising till here. What's surprising is that if copy-paste the
    source code in a new file (.htm), this page is then displayed correctly
    without any problem).
    I've teste with other php pages that display correctly in this browser.
    Ok, so I was wondering if the problem was a problem of headers. I've looked
    both headers (of the .php and .htm pages) with the online tool :

    Then I added this code to make the headers (of the .php and .htm) being
    similar :

    header("ETag: \"e5d8-32a6-c58d3b77\"");
    header("Accept-Ranges: bytes");
    header("Content-Type: text/html");
    header("Last-Modified: Wed, 14 Dec 2005 23:21:31 GMT");

    I've check the headers with the online tool mentioned above and there are
    similar.
    But it still doesn't work...

    Someone has an idea about where the problem can come from ?

    PS: The only error message I get is a short "Sorry, the page cannot be
    displayed". So, no help on that side (this code is generated either by the
    firmware of the DVX-500E or by the media server code on the pc side. Both
    are opaque, proprietary codes).

    Thanks.

    Laurent Compere


  • Erwin Moller

    #2
    Re: special browser cannot display page ...

    Laurent Compere wrote:

    <snip>
    [color=blue]
    > This page cannot be displayed in the browser, however it displays
    > correctly under IE, Mozilla, Netscape.
    > Nothing surprising till here. What's surprising is that if copy-paste the
    > source code in a new file (.htm), this page is then displayed correctly
    > without any problem).[/color]

    Hi,

    Hard to say, but if the same sourcecode is working when saved as a
    html-file, your problem could be fragmented datapackages send by the
    webserver.
    Some browsers, even IE on some OS's, cannot handle that very well.

    Try putting above your script: ob_start();

    That enables output buffering, meaning PHP will send the output in one
    stream.

    I may solve your problem.
    (As you understand: this is just guessing)

    If that doesn't help try this:
    Rename the saved sourcecode to test.php instead od test.html.
    Maybe your (crippled) browser only wants to display stuff named .html.

    Both can be tested very quickly.


    Good luck,
    Erwin Moller

    Comment

    • Chung Leong

      #3
      Re: special browser cannot display page ...

      Try adding a content-length header.

      Comment

      • Laurent Compere

        #4
        Re: special browser cannot display page ...

        First of all, thank you for your help Erwin.
        [color=blue]
        > Hi,
        >
        > Hard to say, but if the same sourcecode is working when saved as a
        > html-file, your problem could be fragmented datapackages send by the
        > webserver.
        > Some browsers, even IE on some OS's, cannot handle that very well.
        >
        > Try putting above your script: ob_start();
        >
        > That enables output buffering, meaning PHP will send the output in one
        > stream.
        >
        > I may solve your problem.
        > (As you understand: this is just guessing)
        >[/color]

        I tried this and it doesn't work.
        [color=blue]
        > If that doesn't help try this:
        > Rename the saved sourcecode to test.php instead od test.html.
        > Maybe your (crippled) browser only wants to display stuff named .html.[/color]

        I did this also even if I was convinced that page would be displayed
        correctly.
        I was wrong. The page cannot be displayed either.
        But this is still very very strange since I can display another page which
        is also php and which is much more complicated than this one (with css,
        javascript, session, cookies, forms, ...). This is for sure a crippled
        browser.

        So so so ... What's the problem ?

        I'm still searching ...

        Laurent Compere.


        Comment

        • Laurent Compere

          #5
          Re: special browser cannot display page ...

          But there is already a content-length header.
          I think now that the problem is somewhere else. That must be something
          really subtle like a big bug ... but I'd prefere to be wrong.

          "Chung Leong" <chernyshevsky@ hotmail.com> a écrit dans le message de news:
          1134663416.8595 17.97550@z14g20 00...legro ups.com...[color=blue]
          > Try adding a content-length header.
          >[/color]


          Comment

          • Chung Leong

            #6
            Re: special browser cannot display page ...

            I have ran into a similiar problem before with Mircosoft ISA before.
            The solution was...convert the dynamic script to plain-o HTML. I would
            get a HTTP sniffer and see what's actually sent by the server. PHP does
            add its own headers.

            One possibility is that the server is using chunk-encoding. Another is
            possibility is compression. I would also try disabling connection
            keep-alive on the server.

            Comment

            • R. Rajesh Jeba Anbiah

              #7
              Re: special browser cannot display page ...

              {top-post fixed. Please don't top-post]

              Laurent Compere wrote:[color=blue]
              > "Chung Leong" <chernyshevsky@ hotmail.com> a écrit dans le message de news:
              > 1134663416.8595 17.97550@z14g20 00...legro ups.com...[color=green]
              > > Try adding a content-length header.[/color]
              > But there is already a content-length header.
              > I think now that the problem is somewhere else. That must be something
              > really subtle like a big bug ... but I'd prefere to be wrong.[/color]

              I just sniffed with LiveHTTPHeader plugin of Firefox.



              GET
              /scripts/Nowoutprint.cfm ?Language=fr&Av ailableIn=Belgi um&TypeAll=true &DisplaySummary =YES
              HTTP/1.1
              Host: www.eurotv.com
              User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
              Gecko/20051111 Firefox/1.5
              Accept:
              text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,ima ge/png,*/*;q=0.5
              Accept-Language: en-us,en;q=0.5
              Accept-Encoding: gzip,deflate
              Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
              Keep-Alive: 300
              Connection: keep-alive
              Cookie: SECONDS=0; HITCOUNT=2; CFID=6733558; CFTOKEN=4615105 8

              HTTP/1.x 200 OK
              Server: Microsoft-IIS/5.0
              Date: Fri, 16 Dec 2005 05:23:59 GMT
              Connection: close
              Set-Cookie: HITCOUNT=0;path =/
              Set-Cookie: SECONDS=5;path=/
              P3P: CP="NOI DSP PSAa PSDa OUR BUS UNI"
              Content-Language: fr-BE
              Content-Type: text/html; charset=UTF-8
              ----------------------------------------------------------

              As Chung said, there is no Content-Length header. As an other way,
              just try logging the $_SERVER vars in a log file at server-end and see
              what your client is actually sending and why the server is responding
              so.

              --
              <?php echo 'Just another PHP saint'; ?>
              Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

              Comment

              • Laurent Compere

                #8
                Re: special browser cannot display page ...

                "R. Rajesh Jeba Anbiah" <ng4rrjanbiah@r ediffmail.com> a écrit dans le
                message de news: 1134711550.7656 54.10470@o13g20 00...legro ups.com...
                {top-post fixed. Please don't top-post]
                [color=blue]
                > I just sniffed with LiveHTTPHeader plugin of Firefox.[/color]
                [color=blue]
                > http://www.eurotv.com/scripts/Nowout...laySummary=YES[/color]
                [color=blue]
                >...[/color]
                [color=blue]
                > As Chung said, there is no Content-Length header. As an other way,
                >just try logging the $_SERVER vars in a log file at server-end and see
                >what your client is actually sending and why the server is responding
                >so.[/color]

                Actually, I haven't tested the header of that page but the one I created in
                php (the one that gets the content of the page you give. And with this one,
                I get a content-length header.
                I'm going to play with this Firefox plugin to see what's really happening on
                the header side.
                But if there would be no content-length header how could I set one since I
                don't know the length (it's a dynamic page) ?

                Thank you


                Comment

                • Laurent Compere

                  #9
                  Re: special browser cannot display page ...

                  "Chung Leong" <chernyshevsky@ hotmail.com> a écrit dans le message de news:
                  1134687205.3808 42.194710@g49g2 00...legr oups.com...[color=blue]
                  >I have ran into a similiar problem before with Mircosoft ISA before.[/color]

                  Microsoft ISA, I don't know that ... What is it ?
                  a web server ?
                  [color=blue]
                  > The solution was...convert the dynamic script to plain-o HTML. I would
                  > get a HTTP sniffer and see what's actually sent by the server. PHP does
                  > add its own headers.[/color]

                  I cannot convert to static page since the content is dynamic.
                  I'm going to play with the firefox plugin mentioned by R. Rajesh Jeba Anbiah
                  to sniff http headers...
                  [color=blue]
                  > One possibility is that the server is using chunk-encoding. Another is
                  > possibility is compression. I would also try disabling connection
                  > keep-alive on the server.[/color]

                  I tried the function ob_start() mentioned by Erwin Moller but it didn't
                  help.
                  I installed the web server myself and didn't add any extension for
                  compression. Is it possible that some compression would be made natively by
                  Apache (2.0.54) ?

                  Thanks


                  Comment

                  • R. Rajesh Jeba Anbiah

                    #10
                    Re: special browser cannot display page ...

                    Laurent Compere wrote:
                    <snip>[color=blue]
                    > I'm going to play with the firefox plugin mentioned by R. Rajesh Jeba Anbiah
                    > to sniff http headers...[/color]

                    If I'm right, you're using a different browser. So, it's better to
                    sniff at the server end too; like what the client is requesting.

                    --
                    <?php echo 'Just another PHP saint'; ?>
                    Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

                    Comment

                    • R. Rajesh Jeba Anbiah

                      #11
                      Re: special browser cannot display page ...

                      Laurent Compere wrote:
                      <snip>[color=blue]
                      > But if there would be no content-length header how could I set one since I
                      > don't know the length (it's a dynamic page) ?[/color]



                      --
                      <?php echo 'Just another PHP saint'; ?>
                      Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

                      Comment

                      • Chung Leong

                        #12
                        Re: special browser cannot display page ...

                        Laurent Compere wrote:[color=blue]
                        > Microsoft ISA, I don't know that ... What is it ?
                        > a web server ?[/color]

                        ISA = Internet Security & Acceleration Server. It's a proxy server cum
                        firewall.
                        [color=blue]
                        > I tried the function ob_start() mentioned by Erwin Moller but it didn't
                        > help.[/color]

                        When you send the contents in one chunk with the help of output
                        buffering, that'd disable chunk encoding by Apache, so that's probably
                        not the problem...
                        [color=blue]
                        > I installed the web server myself and didn't add any extension for
                        > compression. Is it possible that some compression would be made natively by
                        > Apache (2.0.54) ?[/color]

                        Don't think so. PHP can also do on-the-fly gzip compression of output.
                        Try turning it on. I once solved a mystery problem that way. Another
                        thing to try is forcing the use of HTTP 1.0 by sending a "HTTP/1.0 200
                        OK" header.

                        Comment

                        Working...