General PHP Help needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Omega
    New Member
    • Jul 2001
    • 6

    General PHP Help needed

    Hi,

    I'm a n00b to PHP, but I'm doing the best I can to learn it.

    My problem.

    I downloaded a newsscript what generates a textfile with the news in it.

    Now to include it in my PHP page I used

    PHP Code:
    include("news/news.txt"); 
    this works great !

    But now I wanted to include the newsscript itself in a part of my page. So I thought:
    PHP Code:
    include("news/nphpd.php"); 
    But nphpd.php also includes fiels that are in the news dir.
    so I get an error.

    Is there a way to fix this without editing the newsscript?
    sortof a changedir?
  • orca
    Senior Member
    • Mar 2001
    • 1151
    • 5.5.x

    #2
    Hmm, a bit editing of the newsscript is may needed. Just change the path to the included files in the newsscript.
    Ueli

    Comment

    • Mega
      Member
      • Apr 2001
      • 94

      #3
      Got 1 more...


      if I use:
      PHP Code:
      include('news.php'); 
      it works great..
      but with:
      PHP Code:
      include('news.php?page=archive'); 
      I keep getting error

      Comment

      • Conscience
        Member
        • Aug 2001
        • 83

        #4
        nphpd is not designed to be included. therefore there would be some sort of error in doing it...ie something that its calling is conflicting - could be many reasons
        Cons

        Comment

        • Gellpak
          Member
          • Feb 2001
          • 54

          #5
          look in the file and find the output, then change it to a variable that your script echoes? depends on how you're running your script...

          Comment

          • Chexbox
            New Member
            • Aug 2001
            • 20

            #6
            Re: General PHP Help needed

            Originally posted by Omega
            Hi,

            ...
            Now to include it in my PHP page I used

            PHP Code:
            include("news/news.txt"); 
            this works great !

            But now I wanted to include the newsscript itself in a part of my page. So I thought:
            PHP Code:
            include("news/nphpd.php"); 
            But nphpd.php also includes fiels that are in the news dir.
            so I get an error
            ....
            So does that mean that you can't include files that have includes within them?
            (I am also a newbie)

            Comment

            • Gellpak
              Member
              • Feb 2001
              • 54

              #7
              no, usually there is no impediment to including pretty much endlessly like that, just dont put it in a loop, like having one file include a second file that includes the first file, it causes crashes....

              Comment

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