ilikemath2002 Posted January 26, 2009 Share Posted January 26, 2009 Hi, I want to include a script into another script, however; I do not want the script to load directly(and if tried, die;) How can I do this. for example, the file name is example.php <?php include(example1.php); blablabla ?> but I don't want this to be accessed like http://site.com/example1.php only http://site.com/example.php Link to comment https://forums.phpfreaks.com/topic/142437-solved-php-file-name/ Share on other sites More sharing options...
corbin Posted January 26, 2009 Share Posted January 26, 2009 One common way to do it is this: File that will do the including: <?php define('INCLUDED', true); include 'IncludedFile.php'; IncludedFile.php: <?php if(!defined('INCLUDED')) exit; //code here Link to comment https://forums.phpfreaks.com/topic/142437-solved-php-file-name/#findComment-746295 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.