HTML - Password Protect a Web Page ?

How can I password protect a web page that would reqire a user to key a given password to gain access to that page.....  The page is in HTML and I'm using Yahoo's SiteBuilder to contruct the page.  Also, what is a Good/Free HTML editor to use for a beginner
Who is Participating?

Improve company productivity with a Business Account.Sign Up

BillDLConnect With a Mentor Commented:
Hi Qmez

Online Web Site building "Tools" are quite often slow and limited, and may not allow the flexibility of using additional "script" code in your pages.  You need to find that out.

Have a look at Kompozer for a free Web Page editor that will be a very good starting point and may do everything you want in the following years:

You won't get any cheaper than free, and it is a WYSIWYG editor, which means "What you see is what you get" ... well, it never is actually, but it's a good approximation of what a site visitor would see.

Many of the "free HTML editors" you will find in searches using those terms are programs that you write the HTML code and get a split-pane view of how it should look, rather than ones that allow you to insert and arrange content like images directly into the editor in a similar way to a word processing application, and then "preview in browser".

Kompozer is based on the same code that is used in other Mozilla projects like Firefox browser. It started out as "Composer" being integrated right into the Mozilla Suite (browser, email, etc) and then branched off as "NVU" which you will probably have seen listed somewhere if you have searched for free editors. I have always been disinclined to use NVU because it tries to push the "Intuit Web Building Systems" and domain names in your face:

Kompozer allows you to "publish" your website straight to your web storage using FTP. That means File Transfer Protocol and is a standard way to log in and transfer files from computer to server and vice versa.  You would need to find out from the Yahoo help pages for your webspace whether they allow FTP uploads, and if so what the web address is to the root of your storage area.  There should be a page of "settings" for those who prefer to use their own upload methods.  You just set these in Kompozer and you can can upload new, overwrite and update existing, or delete pages and files on or from your web storage area.

The secret to creating your website is the organisation of your pages, files like images and linked documents, and your scripts.  That is something that many online web building tools don't allow you to control. Having your pages and files arranged in separate folders according to the pages they relate to, or according to the nature of the files, makes it much easier to keep track of content once your site grows and more content is added.  If you need to modify a particular page, or an image that shows in a page, you should be able to locate all the files used by that page efficiently.

Having FTPd your locally stored "website to the Server, you will have a mirror image of the content on the server, and some editors allow you to place these side by side and use drag and drop copying, moving, etc between the two and also directly on the server.

If you didn't like the Kompozer method of "publishing" the site using FTP, then there is a great and absolutely free FTP application by CoffeeCup software:
That's what I use, but you will realise if you search for "free FTP" that there are a lot more quality FTP applications for free than there are free "drag and drop" Web Page Editors, eg. FileZilla:

The decision is yours whether you persist with the Yahoo site builder tools and just practice with eg. Kompozer "offline" for now, but I would say that you don't really want to create too much content on the yahoo web space if you intend to later use something like Kompozer.

The reason I say this is that online site builders create quite a lot of their own quirky code and file hierarchies that suit their intentions.  To later try and update the content with pages created in your installed editor can leave a mish-mash of loose files and strange file and folder names.  Downloading, re-editing (ie. removing all the yahoo-centric stuff), and uploading pages that were already created on the yahoo webspace by their site builder can be difficult because of the way they were written.

Better to start now and decide on naming conventions for files, hierarchy for folders, etc, and upload a brand new website to replace the old when you are ready.  There is a lot of help online that gives advice about organising files and folders for a website.

Hope this helps
Also, if you're using Yahoo Site builder already, just use it's HTML editor.
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Do you know what the web server is? Apache? IIS?

Do you have access to the web server settings via a control panel or directly?

If Apache you can use htaccess or if IIS you can use Authentication is IIS.
You password protect a folder where the webpage is located by login to that folder.  That is the way it is done on a normal shared hosting server.  Yahoo may be the same or different.
You can use a javascript to password protect a page with a password. It's not ultra-secure, but it works. If you created a paga named:  "protected.htm" the password required for this script would be "protected"  (no quotes).  Just put this script on any page to show a password box.

The script assumes your pages are in teh same directory and ending in .htm. If it's .html or .php, change the

var suffix = ".htm" to var suffix = ".html", etc.

if your pages are in another directory, you can eliminate the ".htm" and the password will be the folder that is protected. Quick little script, but again ... not ultra-secure. .htaccess is much better.

<SCRIPT language=JavaScript>  
var suffix = ".htm"  
var pass_msg = "Enter your password below to view your page.<P>";  
function go_there()  
location.href = "../" + document.pass_form.pass.value + suffix;
document.write('<br><form name="pass_form" onSubmit="go_there();return false">' + pass_msg + '<br><input type="password" name="pass" size="20" value="">' + '&nbsp;<input type="button" value="OK" OnClick="go_there()"></form>');  
// -->

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.