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");?>

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

Please help with SMTP Authenticated PHP Email Form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat

Filtering an Array Based on Value
I have a very simple script set up that pulls data from a database and is output using this code:

how to get sn motherboard
Hello.
I want to get serial number motherboard, cpu and else hardware.
Can You show me sam

Motivational Posters
Hello,

I wonder how can i do them in php. Are there any sample codes that you can show me?

Stats of viewers
Hello. I have a website in php and people can login. I want to make an admin control panel where u c

Update not working ... please help
Hi,

I am trying to update a row using an edit form by passing id of the row .. but it is not

retrieving more than one max key from an array?
so i have an array of 20 numerical values (0-100) that i need to order from highest to lowest and th

Posting Serialized Data Not Working
I am trying to send an object from one PHP file to another using POST. I serialize the object and th

php unable to sent email
Hi, guys, I try to send a email through php but unfortunately the mail unable to sent. Here is my co

Error when call dll from oracle
Hi all, please help me!

I have dll write C language, I want call it from oracle procedur

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