Jump to content

Recommended Posts

Posted

If it's a pop-up serving an html page, the same way you would any other page.

 

Unless you're talking about prompts and/or alerts, in which case you don't. To password protect a directory you need to use your .htaccess file.

Posted

Actually that's not strictly true - you can use a javascript prompt that takes user arguments (this site uses something similar for formatting). But it won't be in any way secure.

Posted

i was thinkin i could use a popup script and embed the password stuff for access but would it work

 

and its only for one page

Posted

a "pop-up" box would have a few click buttons, normaly 'yes' 'no' or 'cancel' or something like that.

 

a javascripts prompt could take a user input and therefore you could do something similar to what you are describing in a javascript prompt.

Posted
<B>Group name or username:</B> <INPUT size=10 name=user MAXSIZE="10"> 
 <P><B>Password:</B> <INPUT type=password size=10 name=pass MAXSIZE="10"> 
 <P><INPUT type=submit value=Submit> <INPUT type=reset value=Clear>

Posted

but that's not the whole thing, thats a username/password box on a webpage

 

you wanted a "pop-up" aka javascript prompt box and also there's no set username/password, i was wondering for the full source, incl. prompt box + either linking in to a password file or a password itself.... i mean, just replace the real password directory with a fake one, i'll change it.

 

im interesed as ive never done anything more than the most simple password in HTML, and thats visible in the source code! so i wanted more info... show me how, i'll understand it.

Posted

this might work

 
<SCRIPT language="JavaScript">
<!--------

var password;

var pass1="cool";
var pass2="awesome";
var pass3="geekazoid";

password=prompt('Please enter your password to view this page!',' ');

if (password==pass1 || password==pass2 || password==pass3)
 alert('Password Correct! Click OK to enter!');
else
  {
   window.location="jpass.htm";
   }

//----------->
</SCRIPT>

Posted

There's no way to make client-side authentication secure at all. If you want some simple server-side password protection, just use http authentication.

Posted

Or PHP... although that requires learning the language.

 

I could design a script for that rather easily if you told me what to do, but I'd need my book (and maybe a database, I'm not sure).

Posted
a "pop-up" box would have a few click buttons, normaly 'yes' 'no' or 'cancel' or something like that.

That's called a confirmation dialogue. Just couldn't think of the name earlier.

 

 

its on a cjb.net page and they don't allow server-side scripts

Use a .htaccess file.

Posted
I could design a script for that rather easily if you told me what to do, but I'd need my book (and maybe a database, I'm not sure).

That's like 3 minutes of copying and pasting OO blocks.

Posted

<SCRIPT language="JavaScript">
<!--------

var password;

var pass1="cool";
var pass2="awesome";
var pass3="geekazoid";

password=prompt('Please enter your password to view this page!',' ');

if (password==pass1 || password==pass2 || password==pass3)
 alert('Password Correct! Click OK to enter!');
else
  {
   window.location="jpass.htm";
   }

//----------->
</SCRIPT>

 

this does work... that's quite cool, it'll do for my exeriments for now, thanks!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.