RE: [PHP] Inc/Require within includes
| From: | Jesse Binam | Date: | Wed, 23 Aug 2000 07:35:41 +0000 |
| Subject: | RE: [PHP] Inc/Require within includes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13101@lists.php.net to get a copy of this message | ||
I am new to php but have used perl for quite awhile and they are very
similar, I don't use require much, I use include most of the time. You can
do nested calls like that with include so you should be able to with require
as well, since they are practically the same. But I found that when you make
the second call, make sure that the path you specify is relative to the
original script or else you will get errors.
Hope this helps,
Jess
-----Original Message-----
From: Antonio [mailto:antonio@webqual.com]
Sent: Wednesday, August 23, 2000 2:12 AM
To: php-general@lists.php.net
Subject: [PHP] Inc/Require within includes
Hi, I've been having some problems here - and I'm not sure whether
PHP allows this or not. Here's the issue:
Does PHP allow you to require one file from a script, and within the
required file, require a second file?
E.G.
<?php
require "required1.inc";
?>
---- and in required1.inc
<?php
require "required2.inc";
?>
----------
When I try to do this, I get a "Fatal error when opening required2.inc in
required1.inc".
Is there any way to get around this problem? Or am I doing something wrong?
Is having two nested required files a big no-no?
-Antonio
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net