Click to See Complete Forum and Search --> : User prompt


colinmaire
05-07-2003, 10:01 AM
Hi guys,

I know that gonna be stupid but i don t know anything about programmation. so sorry

But i try to put on my website the user prompt password

I copy the script inside my page in the beginning in frontpage
but i don t know what s the password, or where i need to put it in the script someboby can help me ?? please

<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var password = ''
password=prompt('Please enter your password:','');
if (password != null) {
location.href= password + ".html";
}
// End -->
</SCRIPT>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 0.58 KB -->

khalidali63
05-07-2003, 10:08 AM
The above piece of code expects a url as password value and if the password you entered does match a vald html resource in this folder it will open that web page.Its upto you to create webpages with different names and then access them using this logic.
I hope it made any sense..

:D

colinmaire
05-07-2003, 10:10 AM
ok thank but in the script How do i do this

khalidali63
05-07-2003, 10:14 AM
there is nothing you need to do in the script.For e.g
create a simple web page with may be just one line of text and save it as

test.html

Now open the page in which you have th eprompt code.
it should give you a prompt box,input this value in it
test
once you click enter it shoult opoen the test.html page for you.

colinmaire
05-07-2003, 10:19 AM
Thanks Man

khalidali63
05-07-2003, 10:27 AM
You are welcome "Man"

:p