madrazel Posted April 23, 2007 Share Posted April 23, 2007 in example by "require" or "include" ? i need this for function displaying error, that this scrip can not be run on its own Link to comment https://forums.phpfreaks.com/topic/48352-solved-how-to-check-if-particular-script-is-called-from-another-script/ Share on other sites More sharing options...
benjaminbeazy Posted April 23, 2007 Share Posted April 23, 2007 set a variable in the main script and check to see if it is set in the include scripts, ie main script <?php $var = abc"; include("file.php"); ?> include script <?php if($var !== "abc"){ echo "hacking attempt"; exit; } ?> Link to comment https://forums.phpfreaks.com/topic/48352-solved-how-to-check-if-particular-script-is-called-from-another-script/#findComment-236399 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.