Tech Support Forum banner

creating a password to access a link

1147 Views 1 Reply 2 Participants Last post by  Grove
I'm a teacher and I want to post copyrighted powerpoint presentations on my school website. I have authorization to post it to my students, but not to the public, so I need to password-protect that link to those presentations and I can't figure out how to do it. I'm using Microsoft Front Page for creating my web page.
Any ideas?
Thanks!
Status
Not open for further replies.
1 - 2 of 2 Posts
Frontpage ... hmmm. Sorry I don not use Frontpage. I prefer handwriting the code or using Dreamweaver. :smile:

But, I think this is what you want:

Code:
<html>
 <head>
  <script>

function load_private_page
	(	// Parameters:
		prefix, // non-secret portion of
			// URL before the password
		postfix // non-secret portion of
			// URL after the password
	)
{
	// Get secret portion of URL from user:
 	password = prompt ("Access to this page is restricted. " +
		"Please enter access code:", '');

	// Construct entire secret URL using
	// secret and non-secret portions:
	secret_URL = prefix + password + postfix;

	// Load the secret document:
 	document . location . href = secret_URL;
}

  </script>
 </head>
 <body>

    .
    .
    .
    (main document body, including links to public and private pages)
    .
    .
    .

 </body>
</html>
The Hyperlink:

Code:
<a href="javascript: load_private_page ('http://mysite.com/', '.html');">
 private page
</a>
For more information about the code above, go here:

http://sharkysoft.com/tutorials/jsa/content/009.html

Have a fun and computing day,
Grove :cool:
See less See more
1 - 2 of 2 Posts
Status
Not open for further replies.
Top