#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    10
    Rep Power
    0
    Hi,

    If a PHP script writes some html and is included in an SSI, IE treats the HTML as expected and displays the web page, but Netscape seems to display the actual HTML.

    To see what I mean try http://metaget.ukpad.com (this is just a test site) in IE & Netscape.

    There is an index.shtml file that has just one line, as follows:
    <!--#include file="index.php3"-->

    If you try http://metaget.ukpad.com/index.php3 directly, it works fine on either browser.

    Does anyone have a solution to this? I can't use index.php3 as the default page as I do not have control over this (on this virtual server).

    Thanks
    Rik
  2. #2
  3. No Profile Picture
    Robert_J_Sherman
    Guest
    Devshed Newbie (0 - 499 posts)
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by rik:
    Hi,

    If a PHP script writes some html and is included in an SSI, IE treats the HTML as expected and displays the web page, but Netscape seems to display the actual HTML.

    To see what I mean try http://metaget.ukpad.com (this is just a test site) in IE & Netscape.

    There is an index.shtml file that has just one line, as follows:
    <!--#include file="index.php3"-->

    If you try http://metaget.ukpad.com/index.php3 directly, it works fine on either browser.

    Does anyone have a solution to this? I can't use index.php3 as the default page as I do not have control over this (on this virtual server).

    Thanks
    Rik
    [/quote]

    For starters, it's been my understanding that you don't mix SSI and PHP.. you don't include PHP.. so the answer to the question is name the document with the php extension that your server is geared to parse, .php, .php3, etc.. then if you want to "include" a file, like another php or inc file, then use php include() function.

    The reason the SSI include is doing what you describe, is because the PHP3 file is not being server parsed, just SSI included..



    ------------------
    SnR Graphics,
    Low Cost Hosting and Web Development.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    10
    Rep Power
    0
    Thanks Robert, I will contact my host (although neither .php or .php3 work - I have tried them already).

    I didn't know you weren't supposed to mix ssi & php

    The reason the SSI include is doing what you describe, is because the PHP3 file is not being server parsed, just SSI included..


    This is not quite true, if the php3 file were not being parsed, Netscape would display the contents of the PHP3 file rather than the HTML generated after running the PHP3 code.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    10
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Robert_J_Sherman:
    For starters, it's been my understanding that you don't mix SSI and PHP.. you don't include PHP.. so the answer to the question is name the document with the php extension that your server is geared to parse, .php, .php3, etc.. [/quote]

    John, thanks that fixed it. The extension I was after was .phtml

  8. #5
  9. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    I have had no problem including PHP files with SSI in the past, although I agree that it is much better performancewise to use the PHP include functions.

    The real problem above was the server wasn't passing the right header type for the HTML generated by PHP through SSI. Netscape requires the correct header, or the .htm/.html extension whereas IE expects webmasters to be sloppy, so it automatically renders any page with HTML content, regardless of header or extension.

    [This message has been edited by rycamor (edited September 20, 2000).]
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    10
    Rep Power
    0
    Thanks rycamor, that makes sense.

    Incidentally, for anyone else viewing this thread, don't bother trying the links above to see the problem; as the problem is now fixed.

Similar Threads

  1. Good devlopment IDE for PHP that indents code
    By grover in forum Development Software
    Replies: 5
    Last Post: May 6th, 2004, 07:36 AM
  2. embedding html in php for loop
    By IslandBwoy in forum PHP Development
    Replies: 5
    Last Post: February 16th, 2004, 10:15 PM
  3. XHTML not allowing Transitional w/ PHP HTML
    By PFCritics in forum PHP Development
    Replies: 1
    Last Post: February 16th, 2004, 07:32 PM
  4. PHP w/ Javascript - Mozilla adds </script> cuts off my code
    By aikoto in forum JavaScript Development
    Replies: 2
    Last Post: February 8th, 2004, 12:58 PM
  5. fread problem: doesn t compile php code
    By ghorghor2002 in forum PHP Development
    Replies: 2
    Last Post: February 3rd, 2004, 05:25 AM

IMN logo majestic logo threadwatch logo seochat tools logo