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

Php - mysql store data and use it later?
Hi, i' making a login page at the moment, however my username + password is stored many different pl

Looping Problem
I've got a client that has a database with about 200 events at any given time. I'm trying to loop t

Table colours fail when extra row added
Hey Gurus,

I got a weird problem with formating the colour of a table made in php. Everything

how to populate a drop down box
Hi buddies!

PROCEDURE DOWNLOAD_REPORT_FORM (report_name varchar) is begin DOWNLO

PHP Function Page Advice
Hi All, I am quite new to PHP and Javascript but have written an Online Shop (Mainly for Fun and edu

Inserting a variable in a link
I have this code that I want to insert for my own variable but I have no idea how. This is what I wa

rdns with php
I am trying to build a script that will show all of the different domains that are hosted on the sam

.htpasswd Registration Form
Hi,
I wanted to make an htpasswd registration form.
I found this code on the internet but have

Something like an INI editor or a DelimitedText-Editor
Hi all,

Am very, very, very new to PHP and not sure if I should be posting this to a Javascri

a multi dimensional array with for each
hi, I have been asked to write an array, I have Zone 2,3,4,5,6,7,8 each zone has 3 sections of weigh

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