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

PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot rede

timezone change with date()
so i put all my times for posts in my made from scratch forum(not phpbb3 or sm)
in my mysql db u

foreach loop, assistance request
I would like some guidance on the usage of foreach as I try to parse through a large database and wh

TinyMCE / Ajax Postback Problem
Hiya all,

I have a page which loads the TinyMCE editor. On the postback I obviously want to f

how to populate a drop down box
Hi buddies!

PROCEDURE DOWNLOAD_REPORT_FORM (report_name varchar) is begin DOWNLO

Connecion issue
Hi,

For some reason, I keep getting this error when trying to connect:

Warning: mysql_

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

Regular expression tips or resources
Hello! I'm having some issues implementing the appropriate regex patter to eliminate unwanted charac

form problem
below in the form action, i've put "test.php?w=$sw&h=$sh" but when i input the for

User information
Hi All,
By using t-code SUIM we get all the user details,if suppose we donot have permission t

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