DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login

PHP Include within another PHP include

By: | 18 Feb 2009 4:25 pm

I`m wondering if there is a way to place one PHP include within another PHP include file? I have a random quote gnerator placed inside my sidebar which uses the <?php include ... ?> function. When I previed it in the browser, it came out as another error. Is there a way I can do this without using the IFRAME I had to use to make it look right?

I want to thank those that have responded to my posts. I cannot tell you how much I appreciate the help.

Comments




post some of your code, I`m sure someone can help. it sounds like just a
file path problem.

not sure if this would help you or just confuse you, but you`re welcome to
look over my code. if you understand it, I`m sure you can learn some neat
tricks. http://www.prositemanager.com/forum/viewtopic.php?t=2838

By: | 18 Feb 2009

This is what the error is:

Warning: include() [function.include]: Unable to
access /misc/22/148/413/746/6/user/web/tamara-
braun.com/includes/quotes in /misc/22/148/413/746/6/user/web/tamara-
braun.com/sidebar.php on line 77

Warning: include(/misc/22/148/413/746/6/user/web/tamara-
braun.com/includes/quotes) [function.include]: failed to open stream:
No such file or directory in /misc/22/148/413/746/6/user/web/tamara-
braun.com/sidebar.php on line 77

Warning: include() [function.include]: Unable to
access /misc/22/148/413/746/6/user/web/tamara-
braun.com/includes/quotes in /misc/22/148/413/746/6/user/web/tamara-
braun.com/sidebar.php on line 77

Warning: include(/misc/22/148/413/746/6/user/web/tamara-
braun.com/includes/quotes) [function.include]: failed to open stream:
No such file or directory in /misc/22/148/413/746/6/user/web/tamara-
braun.com/sidebar.php on line 77

Warning: include() [function.include]: Failed
opening `/misc/22/148/413/746/6/user/web/tamara-
braun.com/includes/quotes` for inclusion
(include_path=`.:/usr/share/pear`)
in /misc/22/148/413/746/6/user/web/tamara-braun.com/sidebar.php on
line 77

And I did this outside the IFRAME.

Thanks.

By: | 18 Feb 2009

here`s my best guess without seeing more. try this

I think you have something like:
include(`quotes`);

but that is a wrong file name. try this:
include(`quotes.php`);

By: | 18 Feb 2009

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move