473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

password

so hopefully only one more question about this.....

so I have a webpage using frames. I have a header and a column down the
left, and the main body (all of which have different htmls but are brought
together under index.html.
From the header frame I have a list of different options which when clicked
change the body of the page, leaving the header page the same. I have
added a page which uses a 'gatekeeper' to loosely password protect one of
the
pages to be displayed in the main body. The only problem is that with the
current code it is not the body that changes, but rather the header.

How can I adjust this???

Attached 1st is what sends it to the gatekeeper, second is the 'gatekeeper'
code

Any advice?

1.

<HEAD>
<!-- Begin
var nifty_little_window = null;
function gateKeeper() {
nifty_little_window = window.open('gatekeep.html', 'theKeeper',
'width=350,height=200,resizable=1');
}
// End -->
</SCRIPT>
</HEAD>

<body>
<td width="70">
<p align="center"><A HREF="" onMouseOver="gateKeeper()"
class="navgreen">ENTER</A></td>

</body>

2.

<HEAD>

<base target="index">

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

function goForit() {
var location;
var password;
password=this.document.testform.inputbox.value
location=password + ".html"
fetch(location)
theKeeper=window.close()
}
function fetch(location) {
var root;
if (opener.closed) {
root=window.open('','theKeepersGopher','toolbar=ye s,location=yes,status=yes,menubar=yes,scrollbars=y es,resizable=yes,copyhistory=no');
root.location.href = location;
} else {
opener.location.href = location;
}
}
// End -->
</SCRIPT>

<BODY onLoad="top.window.focus()" BACKGROUND="images/background.jpg">
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR>
<TD ROWSPAN=2 WIDTH=50%>
<TD WIDTH=50% ALIGN=CENTER VALIGN=MIDDLE>
<FONT FACE="ARIAL" SIZE=2><B>For Members only.<br>
Please enter the password.<br>
</B></FONT><BR>
<TR>
<TD WIDTH=50% ALIGN=CENTER VALIGN=BOTTOM>
<CENTER>
<FORM NAME="testform">
<INPUT TYPE="text" NAME="inputbox" VALUE="" size=20>
<INPUT TYPE="button" NAME="button" Value="Submit Password"
onClick="goForit(this.form)">
<P></FONT>
</FORM>
</CENTER>
</TABLE>

Nov 15 '06 #1
4 2213
target attribute for the form, and for that matter all the window.opens
and so on...

you have made a rod for your own back here, this is why frames were a
nightmare when they were in fashion. think of all that code that wont
be portable when you finally decide youve got better things to do than
go through the pain of adding another few pages.

your password scheme will only stop absolute beginners, and it gets
"saved" in the addressbar, cache, all caching proxies, the actual box
(unless you turn off autocomplete), the history, and doesnt expire if
the browser is restarted. I would have chosen to use a 1 or 2 line
..htaccess file myself. hassle avoided.

Nov 15 '06 #2

"shimmyshack" <ma********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
target attribute for the form, and for that matter all the window.opens
and so on...

you have made a rod for your own back here, this is why frames were a
nightmare when they were in fashion. think of all that code that wont
be portable when you finally decide youve got better things to do than
go through the pain of adding another few pages.

your password scheme will only stop absolute beginners, and it gets
"saved" in the addressbar, cache, all caching proxies, the actual box
(unless you turn off autocomplete), the history, and doesnt expire if
the browser is restarted. I would have chosen to use a 1 or 2 line
.htaccess file myself. hassle avoided.
As I am a beginner, how would I use a .htaccess file
Nov 15 '06 #3
ASM
prophet a écrit :
"shimmyshack" <ma********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>I would have chosen to use a 1 or 2 line
.htaccess file myself. hassle avoided.

As I am a beginner, how would I use a .htaccess file
The best would be to ask Google.
(or a ng speaking about servers)

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Nov 15 '06 #4
hi yeah, assuming you are on apache you will probably have mod_auth
already installed and running all you need to do is to create an
..htaccess file to prevent access to a directory, files you would write
html as normal but put inside the protected directory, lets call it
"protected"

http://sub.domain.com/protected/

then in notepad or some other text editor you would write these lines.

AuthName "Please Log In"
AuthType Basic
AuthUserFile /absolute/path/to/private/folder/.htpasswd
Require valid-user

the .htpasswd file contains users and their passwords, if no
users/passwords, then just fill it with the "secret" words you were
already going to use in the javascipt
you make the .htpasswd using the program .htpasswd, google for it, it
comes with apache
>htpasswd -c bob -p (-c create)
enter password...
coolhuh
coolhuh
htpasswd -b baldrick -p
yeah
yeah
heres an example of what it then looks like
bob:$9likh98hn09fnhiHIO390=-
baldrick:9klhTV437gi09j09
you can add many "users" so if your secret word was marmelade, just add
that with a blank password.

save the .htaccess file in the dir you are protecting, and save
..htpasswd somewhere private where noone can get it using
http://sub.domain.com/.htpasswd
ie. if your web doc root is /www/public_html
then save ,htpasswd in /www/private/.htpasswd

no need to restart the server, now whenever you try to get
files/images/html/js/css etc... of the form

http://sub.domain.com/protected/file.html
and any subdirectories like

http://sub.domain.com/protected/subdir/file2.html

you will be prompted for a user/pass combo.
Provided the user doesnt close the browser, you will have access to all
files from within there for the duration of the session.

Nov 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: John Victor | last post by:
In my mysql database, I've stored all the passwords using the PASSWORD() function. Now I'm running a test and need to compare the password in my php document to that saved in the database. I used...
3
by: arktikturtle | last post by:
Hi! I'm looking for a way to validate a password within PL/SQL. I want to write CREATE PROCEDURE change_password(old_password IN VARCHAR2) IS BEGIN -- check if old_password is correct... but...
2
by: Jill Elaine | last post by:
I am building an Access 2002 frontend with linked tables to an encrypted Paradox 7 database. When I first create these linked tables, I'm asked for the password to the encrypted Paradox database,...
10
by: Fabrizio | last post by:
(Sorry for the crosspost, but I really don't know which is the right newsgroup!) Hi all, I try to change the password to a user that as to change the password at first logon: try {
6
by: Andre Ranieri | last post by:
I'm trying to create a login page for customers to log into our corporate website, our presidents naturally wants the user and password fields to populate from a cookie so the customer doesn't have...
5
by: scorpion53061 | last post by:
is it possible to set the database password that you can set in access for a database from a vb.net application?
26
by: David Garamond | last post by:
I read that the password hash in pg_shadow is salted with username. Is this still the case? If so, since probably 99% of all PostgreSQL has "postgres" as the superuser name, wouldn't it be better...
8
by: Katash | last post by:
Hello, I am new to PHP and am working on a login system for my site, currently supplied passwords are passed to MySQL and stored as md5 hashes, my question is :- seeing as md5 is 1 way only what...
3
by: julianmoors | last post by:
Hey, Currently I'm writing a VB.NET/1.1 app and I need to mask the input for the password field. Does anyone know how to do this in VB? I've seen a C# example, but wouldn't know how to convert...
2
by: DarthPeePee | last post by:
Hello everyone. I am working on a Password Strength Meter and I am running into 1 problem that I would like to fix. When pressing the "Clear Password & Try Again" button, the password clears...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.