RE: [PHP] Check if php file is an included file?

From: Date: Tue, 15 Jul 2003 07:32:40 +0000
Subject: RE: [PHP] Check if php file is an included file?
Groups: php.general 
Request: Send a blank email to php-general+get-155238@lists.php.net to get a copy of this message
i think we checking in file2.php that it is included by file1.php by using defining constatnta the code something like this file1.php .... define('__FOO_BAR',1) include('file2.php'); ..... file2.php if (!defined('__FOO_BAR')){ doredirect('file1.php'); } //your code goes by here ..... -----Original Message----- From: John Manko [mailto:xerid@adelphia.net] Sent: Tuesday, July 15, 2003 2:26 PM To: php-general@lists.php.net Subject: [PHP] Check if php file is an included file? If have file1.php that includes file2.php, is there any way to check, from file2.php, if it is indeed included. In other words, I don't want file2.php to display (rather redirect to file1.php) if it's not being requested as a file1.php include file. did I confuse you? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#155238) next »