PHP includes problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JDJones

    PHP includes problem

    I'm stumped. I use PHP includes for my menu and page footer. I call them
    with this:

    <?PHP include("/opt2/home3/shared/public_html/mysite/texts/hvmenu.txt"); ?>

    and

    <?PHP include("/opt2/home3/shared/public_html/mysite/texts/footer.txt"); ?>

    Both of these work just fine when I use them on a PHP page in my root
    directory. But when I create a new directory ('test') and use them on a
    page I put in there, only the page footer one displays as it should.

    I have error_reporting (E_ALL); on the page and I do not get any PHP
    error listed. I do not have access to the server logs so I cannot see if
    there's any entry there.

    I know the page has a .php extension, the directory is set to parse
    them, and the file path to the texts is correct. The hvmenu.txt file is
    in /texts where it is supposed to be and renders just fine on the pages
    that call it from my root directory. I've tried IE 6 and NS 7.1 and get
    the same results.

    Anyone have any ideas what's wrong or better yet, how I can cure this?
    Thanks.

  • FLEB

    #2
    Re: PHP includes problem

    Regarding this well-known quote, often attributed to JDJones's famous "Sun,
    01 Feb 2004 18:45:12 GMT" speech:
    [color=blue]
    > I'm stumped. I use PHP includes for my menu and page footer. I call them
    > with this:
    >
    > <?PHP include("/opt2/home3/shared/public_html/mysite/texts/hvmenu.txt"); ?>
    >
    > and
    >
    > <?PHP include("/opt2/home3/shared/public_html/mysite/texts/footer.txt"); ?>
    >
    > Both of these work just fine when I use them on a PHP page in my root
    > directory. But when I create a new directory ('test') and use them on a
    > page I put in there, only the page footer one displays as it should.
    >
    > I have error_reporting (E_ALL); on the page and I do not get any PHP
    > error listed. I do not have access to the server logs so I cannot see if
    > there's any entry there.
    >
    > I know the page has a .php extension, the directory is set to parse
    > them, and the file path to the texts is correct. The hvmenu.txt file is
    > in /texts where it is supposed to be and renders just fine on the pages
    > that call it from my root directory. I've tried IE 6 and NS 7.1 and get
    > the same results.
    >
    > Anyone have any ideas what's wrong or better yet, how I can cure this?
    > Thanks.[/color]

    Try using require() instead of include(), to see if there's any errors
    thrown there.



    --
    -- Rudy Fleminger
    -- sp@mmers.and.ev il.ones.will.bo w-down-to.us
    (put "Hey!" in the Subject line for priority processing!)
    -- http://www.pixelsaredead.com

    Comment

    • Chung Leong

      #3
      Re: PHP includes problem

      Safe mode is on, and hvmenu.txt belongs to the wrong user?

      Uzytkownik "JDJones" <seebelow@spryn et.com> napisal w wiadomosci
      news:YObTb.2029 78$xy6.1042714@ attbi_s02...[color=blue]
      > I'm stumped. I use PHP includes for my menu and page footer. I call them
      > with this:
      >
      > <?PHP include("/opt2/home3/shared/public_html/mysite/texts/hvmenu.txt");[/color]
      ?>[color=blue]
      >
      > and
      >
      > <?PHP include("/opt2/home3/shared/public_html/mysite/texts/footer.txt");[/color]
      ?>[color=blue]
      >
      > Both of these work just fine when I use them on a PHP page in my root
      > directory. But when I create a new directory ('test') and use them on a
      > page I put in there, only the page footer one displays as it should.
      >
      > I have error_reporting (E_ALL); on the page and I do not get any PHP
      > error listed. I do not have access to the server logs so I cannot see if
      > there's any entry there.
      >
      > I know the page has a .php extension, the directory is set to parse
      > them, and the file path to the texts is correct. The hvmenu.txt file is
      > in /texts where it is supposed to be and renders just fine on the pages
      > that call it from my root directory. I've tried IE 6 and NS 7.1 and get
      > the same results.
      >
      > Anyone have any ideas what's wrong or better yet, how I can cure this?
      > Thanks.
      >[/color]


      Comment

      • JDJones

        #4
        Re: PHP includes problem

        FLEB wrote:

        <snip>[color=blue][color=green]
        >>Both of these work just fine when I use them on a PHP page in my root
        >>directory. But when I create a new directory ('test') and use them on a
        >>page I put in there, only the page footer one displays as it should.
        >>
        >>I have error_reporting (E_ALL); on the page and I do not get any PHP
        >>error listed. I do not have access to the server logs so I cannot see if
        >>there's any entry there.
        >>
        >>I know the page has a .php extension, the directory is set to parse
        >>them, and the file path to the texts is correct. The hvmenu.txt file is
        >>in /texts where it is supposed to be and renders just fine on the pages
        >>that call it from my root directory. I've tried IE 6 and NS 7.1 and get
        >>the same results.
        >>
        >>Anyone have any ideas what's wrong or better yet, how I can cure this?
        >>Thanks.[/color]
        >
        >
        > Try using require() instead of include(), to see if there's any errors
        > thrown there.[/color]

        Same result when using require. The page footer displays fine but the
        menu doesn't. Yet when I move the file from 'test' to 'root', both work
        absolutely perfectly.

        Comment

        • JackM

          #5
          Re: PHP includes problem

          >><?PHP include("/opt2/home3/shared/public_html/mysite/texts/hvmenu.txt");[color=blue]
          > ?>
          >[color=green]
          >>Both of these work just fine when I use them on a PHP page in my root
          >>directory. But when I create a new directory ('test') and use them on a
          >>page I put in there, only the page footer one displays as it should.
          >>
          >>I have error_reporting (E_ALL); on the page and I do not get any PHP
          >>error listed. I do not have access to the server logs so I cannot see if
          >>there's any entry there.
          >>
          >>I know the page has a .php extension, the directory is set to parse
          >>them, and the file path to the texts is correct. The hvmenu.txt file is
          >>in /texts where it is supposed to be and renders just fine on the pages
          >>that call it from my root directory. I've tried IE 6 and NS 7.1 and get
          >>the same results.[/color][/color]

          Chung Leong wrote:
          [color=blue]
          > Safe mode is on, and hvmenu.txt belongs to the wrong user?[/color]

          No, safe mode is off. As I said in another reply, what stumps me the
          most is that when I move the file from the 'test' directory and put it
          back into 'root', both includes work just fine. I just can't seem to get
          the menu to display when the file resides in 'test'.

          Comment

          • Cameron

            #6
            Re: PHP includes problem

            JDJones wrote:[color=blue]
            > I'm stumped. I use PHP includes for my menu and page footer. I call them
            > with this:
            >
            > <?PHP include("/opt2/home3/shared/public_html/mysite/texts/hvmenu.txt"); ?>
            >
            > and
            >
            > <?PHP include("/opt2/home3/shared/public_html/mysite/texts/footer.txt"); ?>
            >
            > Both of these work just fine when I use them on a PHP page in my root
            > directory. But when I create a new directory ('test') and use them on a
            > page I put in there, only the page footer one displays as it should.
            >
            > I have error_reporting (E_ALL); on the page and I do not get any PHP
            > error listed. I do not have access to the server logs so I cannot see if
            > there's any entry there.
            >
            > I know the page has a .php extension, the directory is set to parse
            > them, and the file path to the texts is correct. The hvmenu.txt file is
            > in /texts where it is supposed to be and renders just fine on the pages
            > that call it from my root directory. I've tried IE 6 and NS 7.1 and get
            > the same results.
            >
            > Anyone have any ideas what's wrong or better yet, how I can cure this?
            > Thanks.
            >[/color]


            Those paths look like virtual ones, don't see any reason why it should
            cause a problem but if they are then you may want to try the physical
            ones, if you can.

            ~Cameron


            Comment

            Working...