Announcement

Collapse
No announcement yet.

General PHP Help needed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

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

    Comment


    • #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


      • #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


        • #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


          • #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


            • #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...
              X