How to Create a Web Site With Membership & User Login
Designing a web site as a members-only site requires a few extra steps in addition to designing your main site pages. First of all, you will want your default index page to be the login page rather than the main index of the site. You will need to add a database to hold user and password information, and a script to validate that information before allowing a user to proceed. Simple authentication scripts are short and fairly easy to write, but they do require some programming knowledge in addition to standard HTML.
Instructions
-
-
1
Design and build the membership login page. This is a standard HTML page, the look and feel of which can be designed however you like it. Create the login form using the HTML <FORM> tag, with text input fields for members' user names and passwords. You will also need a form or a link to a form where new users can submit registration information.
-
2
Build a database to store users' login information. At the very least, you will need fields for user names and passwords. You may also wish to store other information from the user-registration form, such as full names, addresses, email addresses and phone numbers.
-
-
3
Program an authentication script which will validate information from the user login page against stored information in the database. The script needs to simply check whether the supplied information matches a user name and password set in the database. If it does, the script should pass the user forward to the main pages. If not, the user should receive an error page. Scripts can be written in nearly any programming languages, but common web script languages include PERL, PHP, ASP and JAVA.
-
4
Create a second script to serve your main site pages. Validated user information will be passed forward from the login validation script, and the page server script should simply ensure that this information exists, then serve up the HTML pages. Having your pages served by such a script provides assurance that only validated users can browse your site, rather than creative Internet users finding a way to bypass your login page.
-
1
- Photo Credit monitor with padlock halftone dots image by patrimonio designs from Fotolia.com