Follow @XavierMedia at Twitter.com
Xavier Media
Latest news from Xavier Media
Xavier Tools:
Domain Names | Web Search | Currency Converter | IP Tools | More Tools...
  Domain Name:
 
  Whois Search
  DNS Lookup
  Domains for Sale
 
  Search the Web:
 
  All Xavier sites
  XavierForum.com
  The Web
 
  Currency converter
  Convert
 
  into
 
 
  IP Tools:
  Your IP 38.107.191.94
 
  Look up IP address
  Traceroute
  DNS Lookup
 

CGI Scripts

PHP Scripts

XavierMedia.com

Webmaster Tools

This is a very simple form of web site password protection. Instead of directing people to your main html file, you use this script as a filter to verify users for the password to gain access.

WORKING DEMO

Click here for a working demo of the script. (try login demo and password demo)

HOW IT WORKS

The values that need to be changed in the script are:
$user1 = "demo";
$passwd1 = "demo";
$email1 = "demo\@sampleaddress.com";
user1 is the login name, passwd1 is the password for user1 and email1 is user1's email address.

$protect = "/www/xavier/some/safe/dir/protect.html";
(the page you want to protect)

$owner = "Xavier Media";
(Your name)

$owneremail = "your\@sampleaddress.com";
(Your email address)

$url = "http://www.sampleaddress.com/login.html";
(the URL to the login page)

Use this form to call the script:
<FORM METHOD=post ACTION="http://www.sampleaddress.com/cgi-bin/password.pl">
<INPUT TYPE=hidden NAME=type VALUE="enter">
<B>LOGIN:</B><BR>
<INPUT TYPE=text NAME=login><BR>
<B>PASSWORD:</B><BR>
<INPUT TYPE=password NAME=password><P>
<INPUT TYPE=submit VALUE=" Login ">
</FORM>
Be sure you chmod the password.pl script to 755 (executable) and upload it as ASCII. If you do not know how to make the script executable then contact your server administrator.

Download
TIPS

This script can also be used to protect a directory same way as the PHP password protection script. Click here to read more.

© Copyright 1996-2010 Xavier Media®. All rights reservered.
Contact us | Support/help | Privacy Policy | Company Info | SiteMap
The World According to Xavier | Xavier in the World | the Xavier Media blog