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

foreach result into a single variable
Hi,

I have this code...

Code: [Select]foreach ($_POST['Interests'] as $interest =&

Getting number of affected rows in SQLPLUS..
Hi everyone,
I have a shell script where i am invoking sqlplus, running a query and saving t

Mass activity scheduling
Hi experts,

Im facing some problems to deal with mass activity jobs.
When I run some

Using Windows message as a Handle
Hi,

I am writing one of my first multithreaded programs.

In one of the thread,

I apologise! It's a newbie to PHP feedback form problem!
Hi,

I am a total newbie to PHP. I am also a unemployed and need to get a job. So after 100% r

Error Messaging not working
I changed the way my form tells the user of an error. But I can't seem to get it to work properly.

Turning Data into URLs?
This may seem very basic to you, but I'm having a hard time figuring out how to do this since I don'

path to include folder
Hi everyone,

When I'm testing locally, I have to add the name of the site folder as part of t

bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error

Is this possible? If one file assigned to an ID...
I have a page that lists property listings assigned to a specific user (a manage page), with brief t

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