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

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
what is wrong with this

Code: [Select]<?php
if ($_SERVER['HTTP_REFERER'])
{

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

RadioButtonList data selection
view plaincopy to clipboardprint?

Using unserialize()
Hi there.

I have some data in my database that is serialized.

e.g.

a:2:{i:0

Conditions of info record - Error
When i created GR (901) and PO create automatic my PBXX is obtain the net price of info record but

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

styling a RadioButtonList
HiI need to have a radio button and close to it, its lable, then a space then another set of those.

Warehouse Management
Hi,

On our system, we have two storage locations ( A and B ) where A is the main factory

Get content from table into a list, without repeating.
Alright this is kinda an odd thing, so I need some help.

I have a table "quote" wit

classic dynpro : hide area and auto adjust hights
Hi,

I want to develop a similar user interface as is used in standard transaction MIGO.

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