I have a php file which I will be using as exclusively as an include. Therefore I would like to throw an error instead of executing it when it's accessed directly by typing in the URL instead of being included.
Basically I need to do a check as follows in the php file:
if ( $REQUEST_URL == $URL_OF_CURRENT_PAGE ) die ("Direct access not premitted");
Is there an easy way to do this?
Add this to the page that you want to only be included
die('Direct access not permitted');
then on the pages that include it add
Hope it helps!!
PHP is compiled to byte code before ...READ MORE
You could use the copy() function :
// Will ...READ MORE
The following should help
realpath — Returns canonicalized ...READ MORE
$source = 'Source_file_location'
In the error callback or $.ajax you have three ...READ MORE
If your script is called myScript.js ...READ MORE
Try this code :
// Create an ...READ MORE
Use node-inspector from any browser supporting WebSocket. Breakpoints, ...READ MORE
Add this to the page that ...READ MORE
You can try this:
$query="SELECT * FROM CountryInfo ...READ MORE
Already have an account? Sign in.