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

 formating when pulling data from a mysql database 
Ok so Im not to sure if this is the right thread to post in but here is my catch 22 issue.

I

image upload script not working with png
The basic process of this php code is to take the submitted file, convert it to a small JPG thumbnai

MySQL issue
I am taking sentences through a form on page. Then checking some condition and trying to insert them

Blank record injected into database
I always found several blank records inside my database, although $SESSION is required to insert the

Need some ideas as to how to go about sorting this array...
Here's how the array's are created..

Code: <?php
while ($x = readdir($dp)) {

foreach result into a single variable
Hi,

I have this code...

Code: [Select]foreach ($_POST['Interests'] as $interest =&

New to mysqli library - Multiple query problem
Greetings,

I am writing a batch program that executes 3 queries on a single page. Using mysql

Checking if multidimensional array is empty?
I have a for with multiple test input fields. Specifically the user submits multiple names and ages

Converting RGB values to HEX
Code: <?PHP

$file_handle = fopen("colors/rgb.csv", "r");

wh

Displaying a record from mysql in a simple swf file
Hi,

I have a mysql database containing information I would like to display in my swf.

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