TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-19-2009, 06:23 PM   #1 (permalink)
The Contributor
 
tego10122's Avatar
 
Join Date: Sep 2008
Location: Miami
Posts: 39
Thanks: 7
tego10122 is on a distinguished road
Default Direct Access Help

I need to find out how to define, if the browser is on login.php so (http://domain.com/login.php) If so then render and error ('no direct acess -> redirect(/); , but if login.php was fetched by jquery "lightbox" or a include('login.php'); I want it to show the login form.

Note: its complicated for me because I need it to figure out if its beeing fetched by the website cause anyone can do a include('http://domain.com/login.php'); and get it.
__________________
You're Everyday Graphic Artist
Twitter|GigPark|Linked In
Send a message via MSN to tego10122
tego10122 is offline  
Reply With Quote
Old 05-19-2009, 07:39 PM   #2 (permalink)
The Acquainted
 
Join Date: Oct 2007
Posts: 170
Thanks: 18
maZtah is an unknown quantity at this point
Default

You can define a variable on every page. Then check within the login.php file if the variable is defined before.

So on every page:

PHP Code:
define('ACCESS'TRUE); 
Then on the login.php page:
PHP Code:
if (!defined('ACCESS'))
{
    die(
'No direct access allowed!');

Good luck!
maZtah is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I design my access control system ? amitdgr General 4 04-21-2009 09:21 AM
MS Access via FTP Jenski Advanced PHP Programming 3 02-04-2009 03:27 PM
Building an Apache-like Access Control List (ACL) Wildhoney General 2 12-14-2007 02:03 PM
Do not allow direct access to php file. Sam Granger Absolute Beginners 6 10-17-2007 03:49 PM
How to access functions of Cpanel? jaswinder_rana Absolute Beginners 3 07-15-2005 05:53 PM


All times are GMT. The time now is 11:32 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design