PDA

View Full Version : text box that directs user to his/her password protected page


richelle
11-14-2002, 04:05 AM
I have no idea how to do this, but here is what I'm after:

I have password protected directories on my website which contain sensitive files that I don't want anyone but the administrator and the client to be able to see. Many clients will access the public website, but rather than have the client type out the entire url including their directory/page, I would like to have a text box that they type their user name in and that takes them to their page. (A username/password box pops up that must be correctly entered in order to move on to the next page). Is this possible?

I am trying to work this out on my homepage before mucking up my client's page. For an example, you could go to http://www.motherswebsites.com/allenr/allenr.html
That is where I want the client to go by typing in his/her user name in a box. I would want to put a box (for now) on my homepage--http://www.motherswebsites.com

Am I making any sense? Thanks in advance for any and all help!

glenngv
11-14-2002, 05:44 AM
<html>
<head>
<script language="javascript">
function gotoSite(uname){
if (uname!="") location.href=uname+"/"+uname+".html"
}
</script>
<body>
<form name="frm">
Type your username to enter your site:<br>
<input name="username">&nbsp;<input type="button" value="Go" onclick="gotoSite(this.form.username.value)">
</form>
</body>
</html>

if the user types an invalid username, Page cannot be found error will be displayed.

richelle
11-14-2002, 01:46 PM
This is beautiful, simple code. The only problem I'm having is that it is bypassing the password protection. When the page is pulled up via the code, I want the password window to pop up before the new page is displayed. Is this possible? Thanks so much for your help.

richelle
11-14-2002, 01:58 PM
Never mind! I just had to upload it. (I was checking it on my computer). You are a genius and have made me the happiest woman alive today!!!! Thank you, thank you, thank you.:)

^KoalaBear^
11-15-2002, 06:07 PM
<---- thinks he's gonna have to learn all this javascript thaangy real quick, if it can makes wimmins THAT happy! :D