Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Limiting PHP Include/Require Access?
In order to make editing my site easier on my developers, I've implemented a basic structure including a variety of different php files that I include within my generic pages. However, in the interest of security, I don't want someone who figures out where these files are stored to be able to include them in their own script. Is there any way to limit a php file to where it may only be included within the current domain?
Thanks for your help!
2 Answers
- Anonymous8 years agoFavorite Answer
You place it into a sub folder of one domain. It can no longer be accessed from another domain. And you should really use .htaccess to prevent anyone reading ANY php files.
- ?Lv 48 years ago
you could use sessions and include this a the top of each page :
<?
session_start();
if(!session_is_registered('login'))
{
exit;
}
?>
Edit:
also as Colinc said you could use a .htaccess it will be easier to implement