Akon Posted April 14, 2007 Share Posted April 14, 2007 I am trying to make a layout with include. I am wondering how can I block people viewing those page single like if i have include 'title.php'; and they try to view title.php, is there a way just so the page can just die(); Link to comment https://forums.phpfreaks.com/topic/47020-solved-need-help-on-viewing-pages/ Share on other sites More sharing options...
anthylon Posted April 14, 2007 Share Posted April 14, 2007 Okay, let's say you want use include 'title.php'; in your index.php file. You could do that this way: in the file: index.php put this code: define('access_allowed', 1); in the file: title.php on the most top put: if (access_allowed != 1) { die('Direct access not allowed!'); } That way when somebody open title.php line of code with die() will be activated. If I have understood your question, that could be answer. Link to comment https://forums.phpfreaks.com/topic/47020-solved-need-help-on-viewing-pages/#findComment-229321 Share on other sites More sharing options...
Akon Posted April 14, 2007 Author Share Posted April 14, 2007 Thanks bro for the help Link to comment https://forums.phpfreaks.com/topic/47020-solved-need-help-on-viewing-pages/#findComment-229322 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.