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

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

media recovery
Hi,
i startup the database i got the error

SQL> startup
ORACLE instance started.

mail with attachment problems
Hi. I have the following code:
Code: else if(file_exists("site".$timp.".zip")

import table with dependency
Hi

What is the best way to import table back which has dependency?

SQL> cre

MASS PM
Hello all, I'm trying to send mass private messages to users in my database but keep getting an erro

How to use Ajax to verify data on a DB ?
Hello everyone, well i want to know how to check a value if it exists or not on a Data base and capt

help with multi-update
Now sure how to ask this really....
10g database if that matters.

I have a customer

generate seo frienly url from a text like wordpress
Convert: "åäö" to "aao", "space" to "-", "!?&q

Line break?
Hi, I'm new to the forum and new to php. I'm not sure if I'm using the correct terminology so here i

single page with referrer to show correct page
I have a simple website with a couple of different pages. I would like to be able to in a div tag w

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