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

include
Hi I have this way of licensing my PHP application, and I want to know if you guys can answer some q

Xml parsing
I need a suggestion about parsing xml with multiply parts like pervious...
i.e. different device

shoping cart issues
i´ve wrote this and works when i add an item to, my cart, but when i want to add othrer item just

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

array & querys help/advice.
Ok so here goes , I have a mysql database and basically here's what I need to do.

// foreach

data type in column definition
Hi,
I create a table with column called "Direction of Travel code ".
The travel codes in t

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

mysql_query returning boolean instead of mysql ressource
Hi,

I seem to have a weird issue with the php command mysql_query. I pass 2 arguments the que

iterating through an array and escape each value independently.
I have a set up where the variable being escaped is an array and it needs to be iterated and escaped

Stuck with preg_replace
Hi,

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

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