Block User\'s Direct Access - RMB Scripting
You appear not to have an account with us, Click HERE to register an account...
RMB Scripting
Navigation
  Home
  Contact
  FAQ
  Forum
  Topsites
  Members
  Affiliates
  Arcade <-- New!
  IoxHost
Downloads
  Templates
  Scripts
  Fonts
  Image Sets
  Software
  Other
 
Tutorials
  .htaccess
  Photoshop
  C/C++
  CSS
  Macromedia Flash
  MySQL
  PHP
  PHP - User System
  HTML
  Javascript
  Macintosh
  Macromedia Fireworks
  Visual Basic
  Visual C#
  Windows
  Python
  Other
 
Latest Tutorials
RMB User Commenting Sy...
Easy Navigation Integr...
Decorate Basic Icon
paragraph shortner
Convert Email address ...
Latest Comments
Badge System
Pet system
Pet system
Badge System
Report & Warn Script
Stats
Total Members: 597 [241]
Total Tutorials: 284
Newsest User: andrerds
Todays Unique Hits: 93
Users Online: 1
DanielXP
7 Guests
Poll
What do you look for in a web host?
Price
Uptime
Reviews
Customer Service
Size of Company
Main Content
Tutorial: Block User\'s Direct Access By whalleyboi09
Description
Use This Snippet to create a block function to stop users from accessing Include files directly ... just for some extra security

How To Do it
in your config.php file or w.e. you use add this nice little code

   
CODE:

define('IM_IN_THE_SCRIPT',1); // Create Flag


^ ^
| What Does This Mean ? |


well the IM_IN_THE_SCRIPT is just to label the DEFINE function so we can call it later while were doing the include

and the 1 tel's PHP that it is active so its just a simple way of turning it on and off

Next Part
in your file you would lke to include add this

   
CODE:

if (!defined('IM_IN_THE_SCRIPT')) {
die('Access Restricted...');
exit;
}


^ ^
| Now What Does This Mean ? |


This goes goes to check if the user is accessing the script directly all you have to do now is add that part in all files you want to include weather their important or not


Comments / Questions / Request Goes Below Please :D
Difficulty: Easy
Views: 192
Rating:
Comments
There are currently no comments for this tutorial.
Notice:
Remember to post long codes on our pastbin! - (http://rmb.pastebin.com/)
Add Comment
You must be logged in to post a comment.
Good Afternoon Guest
Username: 
Password: 
Remember Username
Links
RMB Arcade
$2.50 Resellers
Free Domains
Free Games
Affiliates