473,383 Members | 1,953 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,383 software developers and data experts.

pasword

I am trying to have a link from my page to another page which requires a
password so that only certain viewers have access.

How can this be done - I know this may not be a java question but I thought
that I would give it a shot.

Thank you
Nov 13 '06 #1
6 1098
prophet said the following on 11/12/2006 10:59 PM:
I am trying to have a link from my page to another page which requires a
password so that only certain viewers have access.

How can this be done - I know this may not be a java question but I thought
that I would give it a shot.
<form id="myForm">
Password:<input name="password">
</form>
<button onclick="goThere()">Go There</button>

function goThere(){
location.href=document.myForm.password.value + '.html'
}

Then, the password is the name of the file. If they want to get to page
myPage101.html, they put myPage101 in and it goes......

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 13 '06 #2
google for "basic authentication apache" its all done server side, no
client scripting required. its not SSL, but it works for low security
sites, and the password can only be sniffed or bruteforced.

Nov 13 '06 #3
ASM
prophet a écrit :
I am trying to have a link from my page to another page which requires a
password so that only certain viewers have access.

How can this be done - I know this may not be a java question but I thought
that I would give it a shot.
Easiest :

<form action="javascript_needed.htm" method="get"
onsubmit="location='myFolder/'+pass.value+'.html';">
<p>Enter password here :
<input name="pass" type="password" />
and hit touch Enter</p>
</form>

All what you have to do is to name your html file with password
and to place this file in your folder 'myFolder'.

password = 'toto';
file = toto.html

If password is not correct, the visitor will be redirected to the 404
page of server (Page not found)
Better :
use server-side way with : htaccess

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Nov 13 '06 #4
Lee
ASM said:
>
prophet a écrit :
>I am trying to have a link from my page to another page which requires a
password so that only certain viewers have access.

How can this be done - I know this may not be a java question but I thought
that I would give it a shot.

Easiest :

<form action="javascript_needed.htm" method="get"
onsubmit="location='myFolder/'+pass.value+'.html';">
It's dangerous practice to pull the page out from under a form
submission like that. Just use an input button.
--

Nov 13 '06 #5

"prophet" <M_*****@hotmail.comwrote in message
news:V4S5h.296951$5R2.107323@pd7urf3no...
>I am trying to have a link from my page to another page which requires a
password so that only certain viewers have access.

How can this be done - I know this may not be a java question but I
thought that I would give it a shot.

Thank you
So here is what I received from someone and it works ok.

I know that this is going to be so simple to fix, but I have been pulling my
hair out trying to see the forest through the trees......

What I want to do is change the onMouseOver so that when you click on
'ENTER', it goes to the gatekeeper, not just by running the mouse over it.

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


Nov 13 '06 #6
prophet said the following on 11/13/2006 4:33 PM:
"prophet" <M_*****@hotmail.comwrote in message
news:V4S5h.296951$5R2.107323@pd7urf3no...
>I am trying to have a link from my page to another page which requires a
password so that only certain viewers have access.

How can this be done - I know this may not be a java question but I
thought that I would give it a shot.

Thank you

So here is what I received from someone and it works ok.

I know that this is going to be so simple to fix, but I have been pulling my
hair out trying to see the forest through the trees......

What I want to do is change the onMouseOver so that when you click on
'ENTER', it goes to the gatekeeper, not just by running the mouse over it.
Change it from onmouseover to onclick="gateKeeper();return false"

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 13 '06 #7

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

Similar topics

2
by: lubiel | last post by:
Hello, Someone knows the way to encriptar password using ASPs ??? or documentation about it please? Any help is greatly appreciated.
4
by: prophet | last post by:
How do I password protect certain pages within my web site - I want to restrict access to one of my pages so that only a few people can obtain access. Mark
2
by: abhishekparihar1 | last post by:
how to create password control in vb.net with textbox
5
by: HDI | last post by:
Hi, How can I programmatically open a password protected excel-sheet? Thx
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.