How to disable direct access to a file


Posted on 16th Feb 2014 07:03 pm by admin

Suppose I've 2 Files. 1.php & 2.php

I don't want anybody to access 2.php directly from browser. Eg: http://localhost/2.php but I want 2.php show up in 1.php like:
Line number On/Off | Expand/Contract<?phpinclude("2.php");?>
Did you know?Explore Trending and Topic pages for more stories like this.

My question is how can I disable direct access using php not .htaccess
No comments posted yet

Your Answer:

Login to answer
299 Like 38 Dislike
Previous forums Next forums
Other forums

Tree Menu
Hi guys,

Can anyone help me making a tree navigation system? I have a site where I'm allowin

Is there a function ... auto send IP
Is there some function that can be sent to a ddns service that returns the ip address of a ddns forw

array_diff weirdness
I'm using the following bit of code

$diff = array_diff($pids, $pidlist);
$diff = array_va

Error querying database.
I get the above error when trying to insert some values to a datatable.
Here's the code :

Page doesn't expand for content
Hi. I've been testing a query I made. It's here http://lapr1.6te.net/inquerito.php
The page doesn

Stuck with preg_replace
Hi,

I'm trying to use preg_replace to remove part of the IP address submitted using a form on

How to set pass login name from htaccess to php
When the user logs into my members page via htaccess, I'd like to retain the username so that I can

Calander layout
Hi i know this sounds like a simple question but i cant find the answer to it anywhere i have added

Displaying an image using echo command
I had done a query on my database, one of the fields being an image reference to a directory where a

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash