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

login and redirect
hello! can someone help me.. can you give me an idea.. I want to make a login page and redirects it

Linking with Foreign Keys
I have been getting an erro when I try and link:

create table Faculty_Specialty (I_Name v

how to remove in php string display
My code is $message="We're looking at developing our website."; $body= "My mess

php - xml what is the best way to do this.
IN essence I want to have a script calling the info from the database.. I have no problem thus far,

Issues: PHP Forms -Clearing
I've tried looking online before actually asking for help, but I've been looking for about the past

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

RSS poster script?
I have found a script that posts RSS's for me on a site that I'm building. However I would like to a

Header redirect
Hello ive got a problem ive got form with its action set to itself.
Code: <form id="f

Read from a text file after a specific word
Hi all.

I have a text file that looks like the one below.
I know how to open the text fi

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