Get get include pages to work...

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

    Get get include pages to work...

    Greetings,
    I have the following:

    require_once($_ SERVER["DOCUMENT_R OOT"]."/virtuals/doc-root.php4");

    I also have several more include and include once that pull various
    sections into my main page. I am trying to get this working on a local
    machine for testing purposes. I have (windwos) Apache and PHP set up
    on my machine and have written several test pages to confirm things
    are working. When I perform an echo of the Document_root and
    global_root I get the following:

    server doc root: C:/Dewaynewww/TrentonWeb/Apache2/htdocs
    global doc root:

    Anyone have any ideas why I can't using my include/required documents?

    TIA for any help

  • Schraalhans Keukenmeester

    #2
    Re: Get get include pages to work...

    At Thu, 17 May 2007 11:37:35 -0700, dpinion@gmail.c om let his monkeys
    type:
    Greetings,
    I have the following:
    >
    require_once($_ SERVER["DOCUMENT_R OOT"]."/virtuals/doc-root.php4");
    >
    I also have several more include and include once that pull various
    sections into my main page. I am trying to get this working on a local
    machine for testing purposes. I have (windwos) Apache and PHP set up
    on my machine and have written several test pages to confirm things
    are working. When I perform an echo of the Document_root and
    global_root I get the following:
    >
    server doc root: C:/Dewaynewww/TrentonWeb/Apache2/htdocs
    global doc root:
    >
    Anyone have any ideas why I can't using my include/required documents?
    >
    TIA for any help
    I'm not sure about / being valid on windoze. If not, use \\ instead
    (easape the \), or use single quotes.
    It might be a safe mode restriction, or an open_basedir setting keeping
    you from succesfully including.

    You should check what errors you get:

    start your script with:
    error_reporting (E_ALL);
    ini_set("displa y_errors","1");
    and see what errors are displayed.

    HTH
    Sh.

    Comment

    • dpinion@gmail.com

      #3
      Re: Get get include pages to work...

      On May 17, 2:56 pm, Schraalhans Keukenmeester <inva...@invali d.spam>
      wrote:
      I'm not sure about / being valid on windoze. If not, use \\ instead
      (easape the \), or use single quotes.
      It might be a safe mode restriction, or an open_basedir setting keeping
      you from succesfully including.
      >
      You should check what errors you get:
      >
      start your script with:
      error_reporting (E_ALL);
      ini_set("displa y_errors","1");
      and see what errors are displayed.
      >
      HTH
      Thanks. I tried adding in the error scripting, but I don't seem to see
      any errors being generated on the page. I will try switching the
      slash, but my newbie question is how would that effect it once I have
      loaded to a server?

      Thanks again


      Comment

      • Schraalhans Keukenmeester

        #4
        Re: Get get include pages to work...

        At Thu, 17 May 2007 12:03:59 -0700, dpinion@gmail.c om let his monkeys
        type:
        On May 17, 2:56 pm, Schraalhans Keukenmeester <inva...@invali d.spam>
        wrote:
        >
        >I'm not sure about / being valid on windoze. If not, use \\ instead
        >(easape the \), or use single quotes.
        >It might be a safe mode restriction, or an open_basedir setting keeping
        >you from succesfully including.
        >>
        > You should check what errors you get:
        >>
        >start your script with:
        >error_reportin g (E_ALL);
        >ini_set("displ ay_errors","1") ;
        >and see what errors are displayed.
        >>
        >HTH
        >
        Thanks. I tried adding in the error scripting, but I don't seem to see
        any errors being generated on the page. I will try switching the
        slash, but my newbie question is how would that effect it once I have
        loaded to a server?
        >
        Thanks again
        As said, I'm not sure \ isn't allowed on Windows. You may wanna check the
        php manual for that. But since you get no errors it seems fine.

        If you upload it to a non-windows server you'd always have to use \ afaik.

        But, not getting any errors at all with above additions? Hmm, that might
        indicate the files are properly required/included after all.
        Can you show a relevant snippet of your working code?
        If you echo a string following the require, does that display properly?

        Sh.

        Comment

        • dpinion@gmail.com

          #5
          Re: Get get include pages to work...

          On May 17, 3:17 pm, Schraalhans Keukenmeester <inva...@invali d.spam>
          wrote:
          As said, I'm not sure \ isn't allowed on Windows. You may wanna check the
          php manual for that. But since you get no errors it seems fine.
          >
          If you upload it to a non-windows server you'd always have to use \ afaik.
          >
          But, not getting any errors at all with above additions? Hmm, that might
          indicate the files are properly required/included after all.
          Can you show a relevant snippet of your working code?
          If you echo a string following the require, does that display properly?
          >
          Sh
          I tried the echo (you will see it in the code below) but it did not
          display on the screen. I am really new to PHP, so there is a good
          possibility I am doing something wrong...

          <?
          $updated = "4/3/07";
          //$_SERVER["DOCUMENT_R OOT"] = str_replace( $_SERVER["PATH_INFO"],

          //"", ereg_replace( "[\][\]", "/", $_SERVER["PATH_TRANSLATE D"] )

          //)."/";

          require_once("v irtuals/doc-root.php4");
          echo "test";

          ?>
          <html>
          <head>
          <?

          include_once($_ SERVER["DOCUMENT_R OOT"]."/virtuals/header-
          script.php4");

          ?>

          <?

          include_once($_ SERVER["DOCUMENT_R OOT"]."/virtuals/header-home.php4");

          ?>

          I will check the docs to see if windows will support both slashes


          Comment

          • gosha bine

            #6
            Re: Get get include pages to work...

            dpinion@gmail.c om wrote:
            On May 17, 3:17 pm, Schraalhans Keukenmeester <inva...@invali d.spam>
            wrote:
            >As said, I'm not sure \ isn't allowed on Windows. You may wanna check the
            >php manual for that. But since you get no errors it seems fine.
            >>
            >If you upload it to a non-windows server you'd always have to use \ afaik.
            >>
            >But, not getting any errors at all with above additions? Hmm, that might
            >indicate the files are properly required/included after all.
            >Can you show a relevant snippet of your working code?
            >If you echo a string following the require, does that display properly?
            >>
            >Sh
            >
            I tried the echo (you will see it in the code below) but it did not
            display on the screen. I am really new to PHP, so there is a good
            possibility I am doing something wrong...
            >
            [skip]
            >
            I will check the docs to see if windows will support both slashes
            >
            >
            Forward slash ( / ) works perfectly on WIndows systems and it is the one
            you must use in your 'include' and 'require' statements.

            If you're just starting with php, I'd suggest you get one of
            pre-packaged windows installations (e.g.
            http://www.apachefriends.org/en/xampp.html) and let it setup everything
            for you.


            --
            gosha bine

            extended php parser ~ http://code.google.com/p/pihipi
            blok ~ http://www.tagarga.com/blok

            Comment

            • Jerry Stuckle

              #7
              Re: Get get include pages to work...

              Schraalhans Keukenmeester wrote:
              At Thu, 17 May 2007 11:37:35 -0700, dpinion@gmail.c om let his monkeys
              type:
              >
              >Greetings,
              >I have the following:
              >>
              >require_once($ _SERVER["DOCUMENT_R OOT"]."/virtuals/doc-root.php4");
              >>
              >I also have several more include and include once that pull various
              >sections into my main page. I am trying to get this working on a local
              >machine for testing purposes. I have (windwos) Apache and PHP set up
              >on my machine and have written several test pages to confirm things
              >are working. When I perform an echo of the Document_root and
              >global_root I get the following:
              >>
              >server doc root: C:/Dewaynewww/TrentonWeb/Apache2/htdocs
              >global doc root:
              >>
              >Anyone have any ideas why I can't using my include/required documents?
              >>
              >TIA for any help
              >
              I'm not sure about / being valid on windoze. If not, use \\ instead
              (easape the \), or use single quotes.
              It might be a safe mode restriction, or an open_basedir setting keeping
              you from succesfully including.
              >
              You should check what errors you get:
              >
              start your script with:
              error_reporting (E_ALL);
              ini_set("displa y_errors","1");
              and see what errors are displayed.
              >
              HTH
              Sh.
              Schraalhans,

              '/' is perfectly good in windows. Perhaps its' the spaces in your paths?

              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===

              Comment

              • Ravi

                #8
                Re: Get get include pages to work...

                "/" is working fine in windows. please send the code and before check
                that there is any spaces in between /s

                Comment

                • Toby A Inkster

                  #9
                  Re: Get get include pages to work...

                  Schraalhans Keukenmeester wrote:
                  I'm not sure about / being valid on windoze. If not, use \\ instead
                  (easape the \), or use single quotes.
                  '/' has been a valid file separator since DOS 2.x IIRC. Certain DOS and
                  Windows *programs* don't recognise it, but the OS kernel itself does.

                  (Annoyingly COMMAND.COM is/was one of those programs that didn't recognise
                  it!)

                  --
                  Toby A Inkster BSc (Hons) ARCS
                  Fast withdrawal casino UK 2025 – Play now & cash out instantly! Discover the top sites for rapid, secure payouts with no delays.

                  Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux

                  Comment

                  Working...