Jump to content

Basic HTML Pop-Up

Featured Replies

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.

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.

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

But when you say "pop-up", do you mean a pop-up window, or a javascript prompt/alert?

  • Author

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.

the javascript prompt would work for what I want.

  • Author

can you give me the code you are going to use for it?

 

you can use [ code ] tags

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

  • Author

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.

5614 i dont even know how to do it, yet

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>

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

 

No.

 

why not

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.

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.

Use a .htaccess file.

 

im a web design newb, so how??

  • Author

<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!

Archived

This topic is now archived and is closed to further replies.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.