Newbie - SSI vs PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neocronic
    New Member
    • Aug 2000
    • 15

    Newbie - SSI vs PHP

    Right now I am designing the site at http://www.somewebpage.com/neotest/index.shtml

    I use SSI on the page to include the top, the left side, the right side, the bottom, and a image pre-load script in the header (or any script). I do this using ssi such as this...
    <!--#include virtual="page_top.txt" -->

    In the file of "page_top.txt" I have the actual HTML for the top part of the site. I'm sure that you understand..

    Anyway, I want to stop using SSI and start using PHP. I will have PHP and mySQL on the server. Is it possible to do this? The .txt files for the right and left hand parts of the page are quite big (around 2k) so I don't know if I'd want to have all of that in a db. Can I just have "page_top.inc.php" and call that into a .php document when someone visits it?

    I hope that made sense, anyone wanna tackle the question?
    neocronic.com- virtual addiction to a virtual world
    My Forums - Neocronic Support Group
    [email protected]
  • Menno
    Senior Member
    • Apr 2000
    • 1224

    #2
    include ('filename.ext');

    will include any file in the current one

    This can be html, text or even more php code.
    - Insert viable disclaimer here -

    ArtBeast!

    Comment

    • neocronic
      New Member
      • Aug 2000
      • 15

      #3
      Will this work with one script inside of another in another?

      Right now I can include a .txt file with SSI. But if I try to include *another* with an SSI include through that .txt file then it will not appear. It sucks because I like using templates for a lot of the parts that will change a lot.

      What would be the exact tag to use to include a file?

      <? include ="whatever.txt"; ?>

      Is that it?

      Thanks for the help =] I'm still a bigtime PHP newbie.
      neocronic.com- virtual addiction to a virtual world
      My Forums - Neocronic Support Group
      [email protected]

      Comment

      • Menno
        Senior Member
        • Apr 2000
        • 1224

        #4
        check my previous post:

        include ('filename');

        is the code
        - Insert viable disclaimer here -

        ArtBeast!

        Comment

        • carp
          New Member
          • Jul 2000
          • 22

          #5
          <?php include("file.txt") ?>

          Comment

          • neocronic
            New Member
            • Aug 2000
            • 15

            #6
            Another Question

            Will this work with one script inside of another in another?

            Right now I can include a .txt file with SSI. But if I try to include *another* with an SSI include through that .txt file then it will not appear. It sucks because I like using templates for a lot of the parts that will change a lot.
            Like right now I have a file called "page_left.txt" which my index.shtml file is calling up with an SSI include command. But I can not put any more SSI commands inside of page_left.txt or they do not work. Can I have commands more than one "layer" deep? I hope that made sense.
            neocronic.com- virtual addiction to a virtual world
            My Forums - Neocronic Support Group
            [email protected]

            Comment

            • krishmandal
              New Member
              • Aug 2000
              • 5

              #7
              Yes, you can embed and layer the php code, though it's not a good idea to go more than 2 or 3 deep.

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...