4 Replies Latest reply: Dec 24, 2008 4:09 AM by Newsgroup_User RSS

    Firefox 3 displays the php code when pages launched from dreamweaver 8

    gbiras Community Member
      The problem seems to relate to files opening as — file:///C:/localweb/ .... when sent from Dreamweaver 8.0 to Firefox

      The first html/php page loads correctly from dreamweaver as processed HTML, a second page linked from either an HTML or php page also loads correctly, but selecting any link from that or subsequent pages displays the full php code instead of processed html layout - so this appears to be a third level or greater problem.

      If I manually substitute - http://localhost/ — the problem does not arise.

      This is a problem with version 3 of firefox, all previous versions I used worked fine with both — file:///C:/localweb/ and http://localhost/

      Both prefixes also appear with pure HTML sites, but they load and function correctly.

      Not every php site I have loads with file:///C:/localweb/, so I am wondering if this relates to something in the php code or Dreamweaver - I have conn.php set to:

      mysql_connect("localhost", "root", "") or die(mysql_error());

      I use winxp and have xampp installed - everything worked fine until I installed Firefox 3
        • 1. Re: Firefox 3 displays the php code when pages launched from dreamweaver 8
          Newsgroup_User Community Member
          > but selecting any link from that or subsequent pages

          You are being confused by a) not understanding root relative vs document
          relative links, and b) not understanding how DW previews files.

          If I have a document with a link to an image that looks like this -

          <img src="/images/foo.gif"...

          That's what's called a root relative link.

          If I preview that document in DW, then the browser gets the document, sees
          the leading "/" and reads that as the root of the hard drive, since the
          browser has no idea where the root of the site is. Thus, the image is
          broken in the preview.

          If I have temp files enabled, then DW will secretly convert the file being
          previewed into a temporary file, and hand that to the browser. This temp
          file has had all root relative links converted to document relative links
          (as you will see by looking at the code in the browser), and has had all
          include files actually embedded in the page, and has had all external CSS
          and js markup embedded in the page. In other words, DW has made the
          document into a stand-alone page.

          If you do not have temp files enabled, all of these links would be broken on
          preview.

          Now - if you are using root relative links, AND you have temp files enabled,
          AND you click away from the previewed document, then all of your links will
          be broken, since DW has not made that linked file into a temp file. This is
          what you are seeing.

          So - if you want to click away on preview, then you must use document
          relative links for the site -

          <img src="../images/foo.gif"... (for example)

          These will still work on preview since the browser knows how to determine
          the current file's location and how to follow that path.

          Make sense?

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          ==================


          "gbiras" <webforumsuser@macromedia.com> wrote in message
          news:gipp1j$lih$1@forums.macromedia.com...
          > The problem seems to relate to files opening as ? file:///C:/localweb/
          > ....
          > when sent from Dreamweaver 8.0 to Firefox
          >
          > The first html/php page loads correctly from dreamweaver as processed
          > HTML, a
          > second page linked from either an HTML or php page also loads correctly,
          > but
          > selecting any link from that or subsequent pages displays the full php
          > code
          > instead of processed html layout - so this appears to be a third level or
          > greater problem.
          >
          > If I manually substitute - http://localhost/ ? the problem does not arise.
          >
          > This is a problem with version 3 of firefox, all previous versions I used
          > worked fine with both ? file:///C:/localweb/ and http://localhost/
          >
          > Both prefixes also appear with pure HTML sites, but they load and function
          > correctly.
          >
          > Not every php site I have loads with file:///C:/localweb/, so I am
          > wondering
          > if this relates to something in the php code or Dreamweaver - I have
          > conn.php
          > set to:
          >
          > mysql_connect("localhost", "root", "") or die(mysql_error());
          >
          > I use winxp and have xampp installed - everything worked fine until I
          > installed Firefox 3
          >

          • 2. Re: Firefox 3 displays the php code when pages launched from   dreamweaver   8
            Newsgroup_User Community Member
            gbiras wrote:
            > The problem seems to relate to files opening as ? file:///C:/localweb/ ....
            > when sent from Dreamweaver 8.0 to Firefox
            >
            > The first html/php page loads correctly from dreamweaver as processed HTML, a
            > second page linked from either an HTML or php page also loads correctly, but
            > selecting any link from that or subsequent pages displays the full php code
            > instead of processed html layout - so this appears to be a third level or
            > greater problem.
            >
            > If I manually substitute - http://localhost/ ? the problem does not arise.
            >
            > This is a problem with version 3 of firefox, all previous versions I used
            > worked fine with both ? file:///C:/localweb/ and http://localhost/
            >
            > Both prefixes also appear with pure HTML sites, but they load and function
            > correctly.
            >
            > Not every php site I have loads with file:///C:/localweb/, so I am wondering
            > if this relates to something in the php code or Dreamweaver - I have conn.php
            > set to:
            >
            > mysql_connect("localhost", "root", "") or die(mysql_error());
            >
            > I use winxp and have xampp installed - everything worked fine until I
            > installed Firefox 3

            In addition to the excellent advice from Murray, if you have a .PHP page
            with PHP code used on it, like database interaction, you will have to
            preview it using the http://localhost/ route, as it needs to be served
            by a webserver in order to parse the PHP code on the page.

            Your other PHP pages that load without using the server aren't real PHP
            pages, they are HTML pages with a PHP file extension. Any real PHP code
            will be displayed inline as you are experiencing.

            Make sure your testing server is setup correctly.

            Dooza
            --
            Posting Guidelines
            http://www.adobe.com/support/forums/guidelines.html
            How To Ask Smart Questions
            http://www.catb.org/esr/faqs/smart-questions.html
            • 3. Re: Firefox 3 displays the php code when pages launched from   dreamweaver   8
              gbiras Community Member
              Thank you Murray and Dooza

              I did more investigation into the problem and have found that it relates to html framesets. I also made a mistake in my original post.

              The static page links work fine throughout, it is the dynamic links that don't work - i.e. from a selection menu. Obviously because localhost is not invoked.

              If I launch any single html or php page first then it always loads it through http://localhost and all subsequent links and php code work fine.

              I have all of my sites set up with local and testing server versions, all links are site-relative and I do not use temporary files for preview because of the broken links potential.

              The problem therefore boils down to 'why does Dreamweaver launch framesets through 'file:///C:/localweb/' and not ' http://localhost' as it is instructed to in conn.php?
              • 4. Re: Firefox 3 displays the php code when pages launched from   dreamweaver   8
                Newsgroup_User Community Member
                > If I launch any single html or php page first then it always loads it
                > through
                > http://localhost and all subsequent links and php code work fine.

                Don't click away from a previewed page.

                > I have all of my sites set up with local and testing server versions, all
                > links are site-relative and I do not use temporary files for preview
                > because of
                > the broken links potential.

                There is no broken link potential with temp files. If you are using root
                relative links, it's the only way to see them in preview.

                > The problem therefore boils down to 'why does Dreamweaver launch framesets
                > through 'file:///C:/localweb/' and not ' http://localhost' as it is
                > instructed
                > to in conn.php?

                The problem really boils down to why you are using frames in the first
                place.

                --
                Murray --- ICQ 71997575
                Adobe Community Expert
                (If you *MUST* email me, don't LAUGH when you do so!)
                ==================
                http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                ==================


                "gbiras" <webforumsuser@macromedia.com> wrote in message
                news:gis1g1$hm2$1@forums.macromedia.com...
                > Thank you Murray and Dooza
                >
                > I did more investigation into the problem and have found that it relates
                > to
                > html framesets. I also made a mistake in my original post.
                >
                > The static page links work fine throughout, it is the dynamic links that
                > don't
                > work - i.e. from a selection menu. Obviously because localhost is not
                > invoked.
                >
                > If I launch any single html or php page first then it always loads it
                > through
                > http://localhost and all subsequent links and php code work fine.
                >
                > I have all of my sites set up with local and testing server versions, all
                > links are site-relative and I do not use temporary files for preview
                > because of
                > the broken links potential.
                >
                > The problem therefore boils down to 'why does Dreamweaver launch framesets
                > through 'file:///C:/localweb/' and not ' http://localhost' as it is
                > instructed
                > to in conn.php?
                >