Free Password Codes to Protect Web Page

From LoveToKnow Web-Design

There are many reasons a webmaster may want to use free password codes to protect web page content.

Secure Internet

The Benefits of Free Password Codes to Protect Web Page

Sometimes you need password protection for a web page, or at least a portion of a website, in order to keep the public out and allow only authorized users to enter. Some examples of why password protection is necessary:

There are a variety of options to password protect a website, and each option uses a mix of programming languages and web technologies in order to accomplish the task in a secure way.

PHP Password Protection

The PHP web programming architecture provides webmasters the ability to password protect web pages by adding a single line of code to each web page and storing PHP script in the "scripts" folder on the web hosting account. This is one simple approach that doesn't require any advanced programming skills since you can locate php password scripts online.

One example is the Zubrag.com password-protect script, which is a free download. Installation is as simple as copying the password-protect.php file into your "scripts" directory and then adding a single line of code to every web page that you want to password protect. The script uses cookies to determine whether or not the user has already logged in. This means that the user only has to log in once, and then they can access every page that is password protected.

Using ASP to Protect Your Website

ASP, or Active Server Pages, is another technique that a webmaster can use to password protect a website.

ASP is a server side scripting language similar to PHP which allows the processing of user names and passwords to take place at the server. Since processing is not done at the user's browser, the user can't see the source code with the user name and password information.

In the case of ASP, just as with PHP, each page needs to call the login script if the user is not currently logged in. In this case this statement would be placed at the top of the web page as follows:

<%If session("user") = "" Then response.redirect("login.asp")%>

In other cases, some ASP scripts accept input from the web page, in which case you would create a form that accepts the ID and Password from the user, and then the web page hands that information over to the asp script for processing, as shown here:


<form>
<input name=password>
<input type=submit>
</form>

<%If request("password") = "mypassword" Then
Session("user") = "hello"
Response.redirect("secretpage.asp")
End If%>

How you call the ASP script from your web page depends on which script you use. Rather than write one yourself from scratch, it is much easier to download the many free scripts available online, usually called "login.asp". To find a free ASP login script, simply google "free login.asp", and download the file and installation instructions. The instructions will explain how the script gets called from within your HTML web page.

Secure Linux Website Using HTACCESS

Another option for adding password security to a web page is if you are running your website on a Linux server. In this case you have the opportunity to add a file called ".htaccess" to the directory where the protected web page is stored. To get a copy of the .htaccess file and to obtain more information on how to install it, do a web search for ".htaccess", or visit password-protection.com for more information.

Site Security for Amateurs

Sometimes you might want a simple login screen without any complicated server-side processing. If you are blocking access to a web page where security is not very critical, sometimes client-side processing can save a great deal of time.

The Simple Javascript Solution

While using Javascript to present a logon screen to the user is considered the least secure method of password-protecting a website, it is also the simplest and fastest method. The user could always select "view source" in their browser and locate the user name and password within your javascript code, but this is also the login solution that can be completed in less than five minutes simply by adding the following script to the top of your web page.


<script language="javascript">
<!--//
/*This Script prompts the user for a
UserID and Password*/

function paswuser(form) {
if (form.id.value=="userID") {
if (form.pass.value=="password") {
location="targetpage.html"
} else {
alert("Invalid Password")
}
} else { alert("Invalid UserID")
}
}
//-->
</script>

The script above will present the user with a form that asks for a user ID and password. If the ID and password matches the "userID" and "password" you've entered into the script above, it loads "targetpage.html" in the browser.

Also keep in mind that once the user knows the location of "targetpage.html", any user will be able to load that page at any time without having to log in.

The Purchased Solution

Finally, the simplest approach for anyone who knows nothing about web programming is to purchase a software package that installs password-login security on a web page. Many of these software packages, while they all cost money to purchase, do come with free website installation.

The following software packages promise to password-protect your website after the installation procedure is completed:

Choose Website Security Wisely

When searching for free password codes to protect web page content, it's important to take into consideration what level of security you need, whether you want individual IDs and passwords for every user, and how much web programming skill you have. The answer to those questions will help you to decide which of the many available password codes you should choose.



 


Comment on Free Password Codes to Protect Web Page



(Displayed with your comment)                        (Will not be displayed)
Verification Code:   
    

Web Design



E-Mail Updates

Sign up for a free LoveToKnow e-newsletter to get exclusive recipes, decorating tips and great information you need!

Receive offers from our partners.

Read our privacy policy.


PRINT THIS PAGE

EMAIL TO FRIEND





How much do you spend per month on website hosting?






You are here: LoveToKnow » Internet & Technology » Web Design » Web Design Tips and Tutorials » Free Password Codes to Protect Web Page