Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   How can I password protect this page? (http://www.velocityreviews.com/forums/t163309-how-can-i-password-protect-this-page.html)

Narlen 11-01-2005 08:33 AM

How can I password protect this page?
 
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>


=?iso-8859-1?Q?Kim_Andr=E9_Aker=F8?= 11-01-2005 08:38 AM

Re: How can I password protect this page?
 
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ĝ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

PeterMcC 11-01-2005 08:51 AM

Re: How can I password protect this page?
 
Narlen wrote in
<BF8C6874.14E5C%m_narlen@hotmail.com>

> 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.


Narlen 11-01-2005 04:23 PM

Re: How can I password protect this page?
 
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$ed2e19e4@ptn-nntp-reader04.plus.net, "PeterMcC"
<peter@mccourt.org.uk> wrote:

> Narlen wrote in
> <BF8C6874.14E5C%m_narlen@hotmail.com>
>
>> 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.
>



Jemdam.com 11-01-2005 11:58 PM

Re: How can I password protect this page?
 

>
> 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




All times are GMT. The time now is 08:32 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.