Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How can I password protect this page?

Reply
Thread Tools

How can I password protect this page?

 
 
Narlen
Guest
Posts: n/a
 
      11-01-2005
Hi there

I would like to password protect (or "directory listing denied") my website.
I am using the following code. The problem is that if people choose "view
page source" in any web browser it shows the password. Can anyone give me a
code that would hide the password? Thanks a lot for your help.

Here is the code:

<script language="javascript">
<!--//

function pasuser(form) {
if (form.pass.value=="michael2") {
location="index2.html"
} else {
alert("Invalid Password")
}
}
//-->
</script>



<tr><td><h1><i><b>Password:</b></i></h1></td><td><form name="login"><input
name="pass"
type="password"></td></tr>
<tr><td><input type="button" value="Login"
onClick="pasuser(this.form)"></td><td><br>

 
Reply With Quote
 
 
 
 
=?iso-8859-1?Q?Kim_Andr=E9_Aker=F8?=
Guest
Posts: n/a
 
      11-01-2005
Narlen wrote:

> Hi there
>
> I would like to password protect (or "directory listing denied") my
> website. I am using the following code. The problem is that if
> people choose "view page source" in any web browser it shows the
> password. Can anyone give me a code that would hide the password?
> Thanks a lot for your help.
>
> Here is the code:
>
> [snip JavaScript code]


JavaScript is at best flaky, and fairly easy to bypass.

I don't know what web server software your website runs on, but here's
a quick tutorial on how to password protect directories in Apache:
http://www.javascriptkit.com/howto/htaccess3.shtml

(Don't be fooled by the domain name, this particular tutorial doesn't
include any JavaScript code.)

--
Kim André Akerĝ
-
(remove NOSPAM to contact me directly)
 
Reply With Quote
 
 
 
 
PeterMcC
Guest
Posts: n/a
 
      11-01-2005
Narlen wrote in
<BF8C6874.14E5C%>

> Hi there
>
> I would like to password protect (or "directory listing denied") my
> website.


<snip>

How about .htaccess? It's server-side and so more secure than client-side -
and it's dead easy.

http://www.javascriptkit.com/howto/htaccess3.shtml


--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

 
Reply With Quote
 
Narlen
Guest
Posts: n/a
 
      11-01-2005
Thanks for all your suggestions. With all respect, I need more help. I spend
the whole night tring to make it work. I don't know what javascript is but
plain html will do it. Maybe someone could post suitable html code. I would
really appreciate it. (It's an apache server (macintosh powerbook)).

Thank you much


On 11/1/05 12:51 AM, in article
43672c89$0$63063$, "PeterMcC"
<> wrote:

> Narlen wrote in
> <BF8C6874.14E5C%>
>
>> Hi there
>>
>> I would like to password protect (or "directory listing denied") my
>> website.

>
> <snip>
>
> How about .htaccess? It's server-side and so more secure than client-side -
> and it's dead easy.
>
> http://www.javascriptkit.com/howto/htaccess3.shtml
>
>
> --
> PeterMcC
> If you feel that any of the above is incorrect,
> inappropriate or offensive in any way,
> please ignore it and accept my apologies.
>


 
Reply With Quote
 
Jemdam.com
Guest
Posts: n/a
 
      11-01-2005

>
> How about .htaccess? It's server-side and so more secure than
> client-side -
> and it's dead easy.
>
> http://www.javascriptkit.com/howto/htaccess3.shtml
>


Yes, Peter is right .htaccess is the best way, I use it a lot.

Cheers, D http://www.pixelverts.com


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I password-protect a CD / DVD? Hungerdunger Computer Support 18 03-07-2007 02:42 PM
Is there really no one who can help me password protect a page? Narlen HTML 9 11-04-2005 03:42 PM
Looking for a Program to Password Protect Folders But can Read on Another PC Paradox Computer Security 9 12-03-2004 06:24 PM
how can I password protect the cmd program? Bryce Computer Security 4 11-27-2003 03:51 PM
how can I password protect and share a folder? DT Computer Security 1 11-07-2003 10:36 AM



Advertisments