Discussion Locked

Framing in HTML

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How can I effectively create frames in html while working in notepad and how can I set a password for a button in the webpage before the opening of a linked page?

8 replies

by quahsays

not exactly sure of your qn, but, to write HTML pages using notepad requires you to be proficient in the html tags, and one way to learn is to use tool like frontpage, create the frameset, and learn the tags from there.

normal HTML is not meant for such controls as in password. You would need a script, and maybe a database to control. for Windows NT/W2k, you can of course use the ACL to control, but surfer requires IE to work.

by al_<al

Here's a really good ref. for frames:

http://www.w3schools.com/html/html_frames.asp

As for the password, let's look at their example:

-----
--name--->

notice I've given a name attribute to the second element in the frameset.

(BTW, pretend the dashes are white space)

Let's say frame_a.htm has a form button that, when clicked, loads secret.htm. You could add a simple password with Javascript to the button:

by al_<al

Is this SECURE? Absolutely not. View source and you've cracked it. Could you make it a tad more secure? Sure. Store the script in a file named secret.js, link it within the button page, and call the function within the button definition:

The function declaration in secret.js might look like this:

function check4secret() {
var theWord = prompt('What\'s the password?','')
if(theWord && theWord == 'alakazam'){
parent.main.location='secret.htm'
} else if(theWord){
alert('That\'s not the word!!\n\nTry again')
check4secret()
}
}

by al_<al

Whoops! In the function declaration, I should have typed:
'function ask4secret' without the quotes. Also, if what you are trying to protect is at all important, disregard my advice and use a real authentication script!!

This discussion is closed to new replies.