OxyScripts.com
Menu spacer Home Tutorials Articles Code Forums irc.freenode.net #oxyscripts
Main (PHP)
Home Forums PHP News PHP Tutorials Articles PHP Code Snippets Contact Us Sysadmin Resources Books Template Shop
3rd Party Streams
SlashDot PHPDeveloper.org PHP.Net
Resources
PHP Manual MySQL Manual Smarty Manual PEAR Manual PHP-GTK Manual Symfony Manual
Code Snippets
Authentication Database Graphics HTTP Miscellaneous Time/Date
Affiliates
Scripts TutorialMan TutorialGuide CodingForums.com PHP Scripts Cheap Web Hosting Affordable Web Hosting Dreamweaver Templates

Search This Site :     PHP Function Reference :
 
PHP Code Snippets: .htaccess Password Protection
By Akash Goel ( 2006-03-24  7141 views. )
Learn how to super protect your files without the use of mySQL.


This tutorial will help you learn how to password protect your file quickly and easily in a few lines of code.


The code can be split up into three if-else statements. Let's take a look at what we will have to do in order to set up the password protection:

  1. If the user has not been authenticated, then use the PHP header and ask for a username and password.

  2. Else, if the user's name is "spoono" and the password is "spoono", log in. Inside here you would put all the code for the user.

  3. Else tell them the user/password failed.


Some notes about this script: it is essential to note that this username and password will last the whole session, that means that as long as that explorer window is open, the name and password will be saved for that realm. So if you mistyped the name or the password, you'll have to close the explorer window and re-open it and try again. Not too tough was it? Well thats it folks. I hope it works out for you and if it doesn't, email for help at webmaster@spoono.com and we'll try to help you out.
 

 
PHP Code Snippets: Simple IP Address Format Checker
By admin ( 2005-09-11  7173 views. )
There are more extensive ways to do an IP address format check, but this is a good cursory check. Simply call it passing an IP address as a string and it will return true if it's valid, false if it isn't.
 

 
PHP Code Snippets: Array Merge And Replace
By admin ( 2005-05-12  7165 views. )
PHP provides a number of array merging functions but not one that does precisely this. What this will do is that it will add new values found in the new array if they don't exist and update them if they do, performing this recursively if a sub-element of the new array is itself an array.
 

 
PHP Code Snippets: Substr For Words
By admin ( 2005-04-21  7169 views. )
A small function that does similar to what the PHP substr function does, but on words instead.
 

 
PHP Code Snippets: Function To Get The User's IP Address
By admin ( 2005-02-03  7421 views. )
Scans the environment variables and tries to use the one that's most likely to give a reliable result.
 

 
Item(s) 11 to 15 of 57.   Go to page: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
 
   Print this page

Top Sponsor
Symantec\'s Norton SystemWorks 2006
Sponsors
CA
Sponsors
AdWords Dominator 125*125
Advertisting

Affiliates
VertexTemplates PHPFreaks CodeWalkers StarGeek DevScripts CGI & PHP Scripts PHP CMS

Shopping Rebates   Sell It 4 You   Flash Page Counters   Get Insured
GPS Tracking Service   Charity Donate Info   Web Site Hosting   VOIP Service

Privacy Policy | Links | Site Map | Advertising

All content on OxyScripts.com is (©)2002-2007

 
Powered by Adrastea - Version 1.0.0. Copyright © Rune Solutions, 2004-2005