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

2003-07-15 Thread Student4
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:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 2:26 PM
To: [EMAIL PROTECTED]
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2003-07-15 Thread Jason Wong
On Tuesday 15 July 2003 15:25, John Manko wrote:
> 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.

get_included_files()

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
There is nothing more satisfying that having someone take a shot at you, and 
miss
-- Murphy's Military Laws n97
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php