Sayonara Posted January 21, 2005 Posted January 21, 2005 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.
Sayonara Posted January 21, 2005 Posted January 21, 2005 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.
Rakdos Posted January 21, 2005 Posted January 21, 2005 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
Sayonara Posted January 21, 2005 Posted January 21, 2005 But when you say "pop-up", do you mean a pop-up window, or a javascript prompt/alert?
5614 Posted January 21, 2005 Author Posted January 21, 2005 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.
Rakdos Posted January 21, 2005 Posted January 21, 2005 the javascript prompt would work for what I want.
5614 Posted January 21, 2005 Author Posted January 21, 2005 can you give me the code you are going to use for it? you can use [ code ] tags
Rakdos Posted January 21, 2005 Posted January 21, 2005 <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>
5614 Posted January 21, 2005 Author Posted January 21, 2005 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.
Rakdos Posted January 21, 2005 Posted January 21, 2005 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>
Cap'n Refsmmat Posted January 22, 2005 Posted January 22, 2005 No. And the security in using Javascript is minimal, since users can see the password hardcoded in the page.
Dave Posted January 22, 2005 Posted January 22, 2005 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.
Cap'n Refsmmat Posted January 22, 2005 Posted January 22, 2005 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).
Dave Posted January 22, 2005 Posted January 22, 2005 I was going to suggest it but it seems like overkill just for a simple password protected page.
Rakdos Posted January 22, 2005 Posted January 22, 2005 its on a cjb.net page and they don't allow server-side scripts No. why not
Sayonara Posted January 22, 2005 Posted January 22, 2005 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.
Sayonara Posted January 22, 2005 Posted January 22, 2005 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.
Rakdos Posted January 22, 2005 Posted January 22, 2005 Use a .htaccess file. im a web design newb, so how??
Dave Posted January 22, 2005 Posted January 22, 2005 Look up ".htaccess" on google. There's loads of links on it.
5614 Posted January 22, 2005 Author Posted January 22, 2005 <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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now