thanks it all woked, but now i dont know how to chnage the pass, where do i enter the passsword i want to use?
ty
gary
Main Topics
Browse All TopicsHey
i have this code:
<a href="page1.htm" onclick="ConfirmPassword( this ); return false;" > Enter </a>
<script type="text/javascript">
<!--
{
// get the password
var strPassword = prompt( "Please Enter Password Here" );
// Go to the password protected page
window.location.href = "www.domain.com/" + strPassword + "/" + objTargetLink.href;
}
-->
</script>
which only allows people to view my page, if they enter a correct password. i have a few problems with it i am using dw mx 2004.
1. the page loads and then asks for the password so people can see the contents of the page when it asks for the password.
2. the word undifined appears in the password slot, how do i define my password?
any help would be appreciated
thank you
gary
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
umm, well what you have setup is going to do the following,
user clicks on the link and they will be prompted for a password. they enter that password, and then you send them to the page http://www.domain.com/[wha
so if i typed "garypyne" in the prompt, i would be taken to "http://www.domain.com/gar
so, if that was not the right "password" i would get a broken page, if it was right, I would go to a page that works.
This is NOT a good way of doing a password protected site by any means. In fact, if you are looking to truly password protect your site, Javascript is not your answer, it needs to be client side.
that's in there b/c that's what you had in your code.
i would suggest changing it to
// Go to the password protected page
window.location.href = "www.domain.com/" + strPassword + "/"
and if that's the right directory, you'll have the correct index.html page there
ok im so confused right now.
at the moment i have this code
<a href="page1.htm" onclick="ConfirmPassword( this ); return false;" > Enter</a>
<script type="text/javascript">
<!--
function ConfirmPassword(objTargetL
// get the password
var strPassword = prompt( "Please Enter Password Here", "");
// Go to the password protected page
window.location.href = "http://3xd.recongamer.com
}
-->
</script>
ok i think this is all correct. this is the website url:
http://3xd.recongamer.com/
and that is the folder where my protected page is (by the way, theres nothing of importance so im using java cos its supposedly the quickest and easiest :P)
i have a page in there called test.htm
and i want the password to be "hkrules" which is the folder name, therefore th password as well. i inserted this on my website and uploaded it, all it done was display the password i had written in a windows error box, but all it said was the password i ahd eneterd. for example if i entered "pass" as the password the box would show me "pass" and thats it. it did not link me to any pages at all.
is there any chance you could show me exactly what to do.
thank you for all your help so far i really appreciate it
ty
Gary
Business Accounts
Answer for Membership
by: BustaroomsPosted on 2004-11-10 at 13:06:12ID: 12548905
well the undefined thing is solved by this
ink){
// get the password
var strPassword = prompt( "Please Enter Password Here", "" );
the second attribute is the default value for the field
is this the exact code you have on the page? if so, you fogot to give the function you made a name. it should be
<script type="text/javascript">
<!--
function ConfirmPassword(objTargetL
// get the password
var strPassword = prompt( "Please Enter Password Here" );
// Go to the password protected page
window.location.href = "www.domain.com/" + strPassword + "/" + objTargetLink.href;
}
-->
</script>