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

add 20 000 to the rowcnt
Hi ...
I need to add 20 000 to the row count but just cant find a way to do this i am new to php

dinamic "textboxes"?
Ey all, my first post here, i hope its not a hard one

I display mysql results in a table

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

Encrypt php code?
Is it possible to encrypt php code in files,
so that it displays a load of unreadable characters

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

Access database inside of a validation class
Hello,

For quite some time, I have been using functions to validate form input and access the

Hyperlink in PHP to MySQL record
Hello,

I am having trouble as i am new to php. I have connected to the database and I have di

Gaining access to Drop Down Menu Variable
code is below, I am creating a drop down menu. I want to echo the value selected in the drop down me

pull content
I have an existing page, domain/adverts.php which has a good PR. I've just rebuilt my site and the n

Filename like the user name
I am creating a form and storing the values in file. Could anyone please tell me how to write a code

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