includes in php as cgi

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • maniactive@gmail.com

    #1

    includes in php as cgi

    I am in the process of moving a site to a new server.

    On the old server, these two functions:

    <?include("head er.shtml");?>

    and

    <?include("foot er.shtml");?>

    allowed me to successful include a simple header and footer on every
    page of the site.

    However: on the new server, php is installed as cgi.

    What function will allow me to successfully include the header and
    footer files with this configuration? The host swears that shtml works
    perfectly as an include for the php installed as cgi configuration --
    but I cannot get it to work with this standard command.

    Anybody have any ideas?

  • Good Man

    #2
    Re: includes in php as cgi

    maniactive@gmai l.com wrote in news:1182451556 .344094.198280
    @c77g2000hse.go oglegroups.com:

    However: on the new server, php is installed as cgi.
    >
    What function will allow me to successfully include the header and
    footer files with this configuration? The host swears that shtml works
    perfectly as an include for the php installed as cgi configuration --
    but I cannot get it to work with this standard command.
    >
    Anybody have any ideas?
    it shouldn't make a difference, but perhaps double-check the path? It may
    require the full server path to the file, ie:

    <?php include("/path/to/include.php"); ?>

    as oppposed to

    <?php include("includ e.php"); ?>

    Comment

    • maniactive@gmail.com

      #3
      Re: includes in php as cgi

      it shouldn't make a difference, but perhaps double-check the path? It may
      require the full server path to the file, ie:
      >
      <?php include("/path/to/include.php"); ?>
      >
      as oppposed to
      >
      <?php include("includ e.php"); ?>
      Thanks for responding Good Man!

      Nope, that didn't work either....but you did provide an important
      clue.

      I was using

      <?include("head er.shtml");?>

      and you suggested

      <?php include("header .shtml");?>

      I tried that, too -- but no luck. I also tried the path...and the
      server path.

      Still no luck.

      Thanks anyway.

      Any other ideas?

      Comment

      • maniactive@gmail.com

        #4
        Re: includes in php as cgi

        it shouldn't make a difference, but perhaps double-check the path? It may
        require the full server path to the file, ie:
        >
        <?php include("/path/to/include.php"); ?>
        >
        as oppposed to
        >
        <?php include("includ e.php"); ?>
        Thanks for responding Good Man!

        Nope, that didn't work either....but you did provide an important
        clue.

        I was using

        <?include("head er.shtml");?>

        and you suggested

        <?php include("header .shtml");?>

        I tried that, too -- but no luck. I also tried the path...and the
        server path.

        Still no luck.

        Thanks anyway.

        Any other ideas?

        Comment

        • maniactive@gmail.com

          #5
          Re: includes in php as cgi

          it shouldn't make a difference, but perhaps double-check the path? It may
          require the full server path to the file, ie:
          >
          <?php include("/path/to/include.php"); ?>
          >
          as oppposed to
          >
          <?php include("includ e.php"); ?>
          Thanks for responding Good Man!

          Nope, that didn't work either....but you did provide an important
          clue.

          I was using

          <?include("head er.shtml");?>

          and you suggested

          <?php include("header .shtml");?>

          I tried that, too -- but no luck. I also tried the path...and the
          server path.

          Still no luck.

          Thanks anyway.

          Any other ideas?

          Comment

          • maniactive@gmail.com

            #6
            Re: includes in php as cgi

            it shouldn't make a difference, but perhaps double-check the path? It may
            require the full server path to the file, ie:
            >
            <?php include("/path/to/include.php"); ?>
            >
            as oppposed to
            >
            <?php include("includ e.php"); ?>
            Thanks for responding Good Man!

            Nope, that didn't work either....but you did provide an important
            clue.

            I was using

            <?include("head er.shtml");?>

            and you suggested

            <?php include("header .shtml");?>

            I tried that, too -- but no luck. I also tried the path...and the
            server path.

            Still no luck.

            Thanks anyway.

            Any other ideas?

            Comment

            • maniactive@gmail.com

              #7
              Re: includes in php as cgi

              it shouldn't make a difference, but perhaps double-check the path? It may
              require the full server path to the file, ie:
              >
              <?php include("/path/to/include.php"); ?>
              >
              as oppposed to
              >
              <?php include("includ e.php"); ?>
              Thanks for responding Good Man!

              Nope, that didn't work either....but you did provide an important
              clue.

              I was using

              <?include("head er.shtml");?>

              and you suggested

              <?php include("header .shtml");?>

              I tried that, too -- but no luck. I also tried the path...and the
              server path.

              Still no luck.

              Thanks anyway.

              Any other ideas?

              Comment

              • axlq

                #8
                Re: includes in php as cgi

                In article <1182453968.263 730.48010@p77g2 000hsh.googlegr oups.com>,
                <maniactive@gma il.comwrote:
                ><?php include("header .shtml");?>
                >
                >I tried that, too -- but no luck. I also tried the path...and the
                >server path.
                >Still no luck.
                >Thanks anyway.
                >Any other ideas?
                Well, the php include directive is suppose to include other php
                code. It appears (and I'm guessing) that you are including an HTML
                file, which should be output rather than executed as PHP.

                Why not just say
                <?php readfile("heade r.shtml"); ?>

                That's what you should do if the file you're reading is simply text
                or HTML that you want to output.
                See http://us.php.net/manual/en/function.readfile.php

                If that doesn't work, then I think your next step is to contact your
                hosting services tech support; after all, they are the ones who seem
                to have provided a broken implementation of php.

                -A

                Comment

                Working...