I found the following sample script code:
I have a need to password protect some pages and would like to have support for both username and password. Tight security is not a real issue, we just want to use this to encourage people to register on the site.
Is there a way to edit the above sample so it will accept input for both a user name and a password?
Next step is I would like the user to only be prompted once for a group of pages. So I assume I require the use of a cookie.
I know how to do this easily with ASP code, but my customer is not using a Windows Web Server.
Many thanks for any assistance, JavaScript is not my area of expertise, vbscript is and the customers server prevents me from leveraging my vbscript knowledge.
Code:
<script type="text/javascript">
var pw =prompt('Please Enter a Password to View Protected Content: ','');
if (pw != 'XYZ') top.location = 'index.html';</script>
I have a need to password protect some pages and would like to have support for both username and password. Tight security is not a real issue, we just want to use this to encourage people to register on the site.
Is there a way to edit the above sample so it will accept input for both a user name and a password?
Next step is I would like the user to only be prompted once for a group of pages. So I assume I require the use of a cookie.
I know how to do this easily with ASP code, but my customer is not using a Windows Web Server.
Many thanks for any assistance, JavaScript is not my area of expertise, vbscript is and the customers server prevents me from leveraging my vbscript knowledge.