Qmez
asked on
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
http://www.mtopsoft.com/htmllock/yahoositebuilder.htm
Also, if you're using Yahoo Site builder already, just use it's HTML editor.
http://webhosting.yahoo.com/ps/sb/index.php
http://webhosting.yahoo.com/ps/sb/index.php
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.
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.va lue + suffix;
}
document.write('<br><form name="pass_form" onSubmit="go_there();retur n false">' + pass_msg + '<br><input type="password" name="pass" size="20" value="">' + ' <input type="button" value="OK" OnClick="go_there()"></for m>');
// -->
</SCRIPT>
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.va
}
document.write('<br><form name="pass_form" onSubmit="go_there();retur
// -->
</SCRIPT>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.