Question:
DOES ANYONE KNOW HOW TO FIX THIS? (PHP includes dont work on sub pages)?
Jess
2008-11-17 23:49:28 UTC
OMGGGG I've been trying and trying and trying but i cant figure it out.

LOOK AT MY FIRST QUESTION:
http://answers.yahoo.com/question/index;_ylt=AqnAIeKP6RnJHO537i.PFofsy6IX;_ylv=3?qid=20081116221841AAsqHws


Go to my web www.thatcake.net. then click resources. the includes work fine bu when you click on a sub page eg: brushes it DOESNT!

WHY?

This is what comes up whe nI do click another page eg: brushes:


Warning: main(header.php) [function.main]: failed to open stream: No such file or directory in /home/thatcake/public_html/resources/brushes.php on line 1

Warning: main(header.php) [function.main]: failed to open stream: No such file or directory in /home/thatcake/public_html/resources/brushes.php on line 1

Warning: main() [function.include]: Failed opening 'header.php' for inclusion (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php') in /home/thatcake/public_html/resources/brushes.php on line 1

and for the footer it says:


Warning: main(footer.php) [function.main]: failed to open stream: No such file or directory in /home/thatcake/public_html/resources/brushes.php on line 45

Warning: main(footer.php) [function.main]: failed to open stream: No such file or directory in /home/thatcake/public_html/resources/brushes.php on line 45

Warning: main() [function.include]: Failed opening 'footer.php' for inclusion (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php') in /home/thatcake/public_html/resources/brushes.php on line 45



IF YOU HELP ME FIX IT I WIL LGIVE YOU 20 PINTS! I'LL PUT ANOTHER QUESTION UP FOR YOU TO ANSWER AND YOU WILL BE CHOOSEN SO PLEASE HELP MEEE :)
Three answers:
just "JR"
2008-11-18 00:36:16 UTC
You include seems to be included in the first page, but not on the others OR your secondary pages are not in the same directory as your primary page.

Also, instead of using "include" with Php, use

require_once ( " footer.php " );

that you put at the top, even before the headers

Remember, the include files MUST be in the SAME folder as the file calling them, OR the full path must be given (ie "http://mysite.com/subdir/footer.php").
Chris C
2008-11-18 14:18:23 UTC
If you shoot me an email on Yahoo! Answers, I'll respond with a real address that you can send me the PHP files to and I can possibly fix the issue for you.

I will also tell you what I fixed so that you can learn from this experience.
yaoiboii
2008-11-18 07:57:22 UTC
The files, header.php and footer.php, are not in the resource folder or linked correctly.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...