This is the source code and links for Chapter 20 of CGI Programming 101.

Chapter 20: Password Protection


Name Description
register-cgi.html User Registration Program - for .htaccess file (source code)
register.html User Registration Program - for .htaccess file (example)
register2-cgi.html User Registration Program - for mod_auth_mysql (source code)
register2.html User Registration Program - for mod_auth_mysql (example)
forgotpass-cgi.html Forgot-my-Password Program - for MySQL (source code)
forgotpass.html Forgot-my-Password Program - for MySQL (example)
passchg-cgi.html Change Password Program - for MySQL (source code)
secure2/passchg.html Change Password Program - for MySQL (example)
users-pm.html Cookie-based Authentication: Users module (source code)
login-cgi.html Cookie-based Authentication: Login program (source code)
login.cgi Cookie-based Authentication: Login program (example)
login2-cgi.html Cookie-based Authentication: Login program pt. 2 (source code)
securepage-cgi.html Cookie-based Authentication: Secure Page (source code)
securepage.cgi Cookie-based Authentication: Secure Page (example)
logout-cgi.html Cookie-based Authentication: Logout Program (source code)
logout.cgi Cookie-based Authentication: Logout Program (example)

Errata

Under Cookie-Based Authentication, if you include the IP address check in your user validate script, this could cause some users to be unable to login. Drop the IP address check for better compatibility.


Resources