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

post to self
Trying to get my form to submit to itself. However I am also trying to use an image for my submit bu

Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc

Problem with HTML form
Hello,

I made a HTML form with some fields and check box.
Everything works fine except whe

Is it possible to stop reservation creation in PM Order?
Hi All,

Is it possible to stop reservation creation in PM Order?

Thanks in adv

Creating a custom API
I'm creating a site, and I need to create a basic API. Unfortunately I have no idea where to start.

PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in.
Moderator

in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)

Examp

undefined offset help
Hi All,

I kept getting undefined offset PHP notice for a simple for loop. For eg
$va = arr

Casting Decimals in Oracle
This code worked as a query in DB2, but I am not sure what the syntax is for casting decimals in Ora

Does design fit in FPGA ?
Hi all,

I've made a large HCC-Design. Because of the program-size the compile process with th

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