PDA

View Full Version : General PHP Help needed


Omega
Mon 20th Aug '01, 9:26am
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


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:

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
Mon 20th Aug '01, 11:58am
Hmm, a bit editing of the newsscript is may needed. Just change the path to the included files in the newsscript.

Mega
Tue 21st Aug '01, 9:03am
Got 1 more...


if I use:

include('news.php');


it works great..
but with:

include('news.php?page=archive');


I keep getting error

Conscience
Wed 22nd Aug '01, 1:41am
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

Gellpak
Thu 23rd Aug '01, 10:59am
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...

Chexbox
Sat 25th Aug '01, 3:11pm
Originally posted by Omega
Hi,

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


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:

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)

Gellpak
Sat 25th Aug '01, 4:22pm
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....