WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Prevent Standalone Execution of a PHP Script
Categories : PHP, Security Click here to Update Your Picture
John Paseur
Date : May 20th 2006
Grade : 2 of 5 (graded 3 times)
Viewed : 3080
File : 4404.php
Images : No Images for this code example.
Search : More code by John Paseur
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

Many of my scripts are designed to interact with included files or as subsets of other scripts. In most cases, output is unpredictable unless these scripts are "included" with their cohort. This simple statement, inserted at the top line of the script, protects against standalone execution. Instead it loads the home page.


[code]
<?php // DO NOT RUN THIS SCRIPT STANDALONE
if (count(get_included_files()) < 2) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: /");
exit();
}
?>
[code]



A damaged image generator (class) for validating text. CAPTCHA - Completely Automated Public Turing test to tell Computers and Humans Apart
Categories : PHP, PHP Classes, Security, GD image library, Security
Function to generate readable/remeberable random password
Categories : PHP, Security, Security
Protect your email links from being spidered by spam email robots!
Categories : PHP, Security, Mail, Email
Encoding data using PGP via PHP's proc_* functions
Categories : Cryptography, Security, Email, PHP, PGP
Creates a CAPTCHA image in PHP, which displays 5 numbers stored in a session.
Categories : PHP, GD image library, Form Processing, Security
Dollar Serial Number Validator
Categories : PHP, Security, Algorithms
send_mail function to defeat Header Injection Hacking/Spamming
Categories : PHP, Email, Form Processing, Security
IPTables Bandwidth statics
Categories : PHP, Security, Network
Random Password Generator
Categories : PHP, Strings, Security
Passgen: Automatically generate mixed case alpha numeric passwords
Categories : PHP, Security
A very simple PHP single password cookie based login without usernames.
Categories : PHP, Cookies, Security, Beginner Guides
Generating and Matching Secure and Strong Password Hash
Categories : PHP, PHP Classes, Cryptography, Security
PHP Cookies - Simple cookie write/read methods that allow basic encryption
Categories : PHP, Cookies, Security, Encryption
Forms protected from XSS attacks (FOPAXSS)
Categories : PHP, PHP Classes, Form Processing, Security
Authenticator for Exchange Server LDAP
Categories : PHP, Authentication, LDAP, Security, Sessions