7 Replies Latest reply on Jun 29, 2006 6:10 AM by artofflash

    PHP include in Template

    artofflash
      Dear Forum users,

      I have created a Template, saved it as PHP, in one table there is an include code:

      <?php
      include ("../file.inc.php");
      ?>

      It works in the related file, just there are some strange characters showing up in the browser window:

      

      (How) can I get those out?

      Thank you very much for your help!
      M.
        • 1. Re: PHP include in Template
          jeremyluby Level 3
          what are the contents of the file.inc.php file?

          Can you attach that code here
          • 2. Re: PHP include in Template
            Level 7
            Strange characters? You want us to guess which ones?

            --
            Murray --- ICQ 71997575
            Adobe Community Expert
            (If you *MUST* email me, don't LAUGH when you do so!)
            ==================
            http://www.dreamweavermx-templates.com - Template Triage!
            http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
            http://www.dwfaq.com - DW FAQs, Tutorials & Resources
            http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
            ==================


            "artofflash" <webforumsuser@macromedia.com> wrote in message
            news:e7ul5o$1km$1@forums.macromedia.com...
            > Dear Forum users,
            >
            > I have created a Template, saved it as PHP, in one table there is an
            > include
            > code:
            >
            > <?php
            > include ("../file.inc.php");
            > ?>
            >
            > It works in the related file, just there are some strange characters
            > showing
            > up in the browser window:
            >
            > ???
            >
            > (How) can I get those out?
            >
            > Thank you very much for your help!
            > M.
            >


            • 3. Re: PHP include in Template
              artofflash Level 1
              Hi Murray,

              I posted the characters in my first message. It is just 3 of them:

              

              jeremyluby: The include file is just a test file and contains the following code:

              <?php

              echo "<tr>
              <td width=\"161\">name</td>
              <td width=\"13\"> </td>
              </tr>";
              ?>

              This gets displayed right, but just after those 3 characters...
              Thanks for your help!
              • 4. Re: PHP include in Template
                Level 7
                You can see how this looks below.

                Can you show me the top 10 lines of code from the doctype down?

                --
                Murray --- ICQ 71997575
                Adobe Community Expert
                (If you *MUST* email me, don't LAUGH when you do so!)
                ==================
                http://www.dreamweavermx-templates.com - Template Triage!
                http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                ==================


                "artofflash" <webforumsuser@macromedia.com> wrote in message
                news:e7usgf$akj$1@forums.macromedia.com...
                > Hi Murray,
                >
                > I posted the characters in my first message. It is just 3 of them:
                >
                > ???
                >
                > jeremyluby: The include file is just a test file and contains the
                > following
                > code:
                >
                > <?php
                >
                > echo "<tr>
                > <td width=\"161\">name</td>
                > <td width=\"13\"> </td>
                > </tr>";
                > ?>
                >
                > This gets displayed right, but just after those 3 characters...
                > Thanks for your help!
                >


                • 5. Re: PHP include in Template
                  Level 7
                  ahem... did you try a search for those three question marks in your
                  "ENTIRE LOCAL SITE" ?

                  Either you didn't set the character encoding in the head section and
                  have some weird characters that your browser can't display (in
                  combination with a wrong or missing doctype declaration maybe?)

                  or

                  they somehow ended up in the HTML (which can also happen when parts of
                  the HTML are "broken up")

                  Anurag







                  artofflash wrote:
                  > Hi Murray,
                  >
                  > I posted the characters in my first message. It is just 3 of them:
                  >
                  > ???
                  >
                  > jeremyluby: The include file is just a test file and contains the following
                  > code:
                  >
                  > <?php
                  >
                  > echo "<tr>
                  > <td width=\"161\">name</td>
                  > <td width=\"13\"> </td>
                  > </tr>";
                  > ?>
                  >
                  > This gets displayed right, but just after those 3 characters...
                  > Thanks for your help!
                  >
                  • 6. Re: PHP include in Template
                    Level 7


                    > I posted the characters in my first message. It is just 3 of them:
                    >
                    > ???

                    The thing is that most of the people who reply here are using news reader,
                    and we see this:

                    ???

                    so we don't see the same thing.

                    Please give a url address to the page, and a url address to the include.
                    include ("../file.inc.php");
                    What url to view it directly.
                    And: is it a complete document, or just what would make sense where it's
                    being used.

                    • 7. Re: PHP include in Template
                      artofflash Level 1
                      Hey guys,

                      SORRY ... how could I assume that you would see the same characters...
                      But you led me to the solution of the problem:
                      I have inserted

                      <?php header("Content-type: text/html; charset=utf-8");?>

                      at the top of the template, and everything works fine now!

                      Thanks a lot for your help - hints - patience ;-)