Hi I hope someone out there can answer this, but I have develepoed a very small website for access to online online storage of some data and is password protected but does not work properly with Firefox only IE.
I am using this Javascript :
<script>
// Author: Schubert(16) - [email protected]
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
function ask()
{
pass=prompt("This portal is password protected. Enter the password below. ","");
if(pass=="Password" && pass!=null)
{
alert("Correct password. Access granted");
}
else
{
alert("Incorrect password. Access denied")
history.back(1);
}
}
window.onload=ask
//stop-->
</script>
This work a treat but does not work with Firefox. Even if you enter a wrong password is will display the erro but remain on the page and not go back to the previos one. Is there a command that I can use to redirect it to a particular page instead of back and will work with both browsers.
Dont really wanty to go to the hassle of PHP.
Not really my strong point I concentrate on Networks (3rd Degree Student), but have not done JavaScript or CSS/HTML. I use Frontpage 2003.
I am using this Javascript :
<script>
// Author: Schubert(16) - [email protected]
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
function ask()
{
pass=prompt("This portal is password protected. Enter the password below. ","");
if(pass=="Password" && pass!=null)
{
alert("Correct password. Access granted");
}
else
{
alert("Incorrect password. Access denied")
history.back(1);
}
}
window.onload=ask
//stop-->
</script>
This work a treat but does not work with Firefox. Even if you enter a wrong password is will display the erro but remain on the page and not go back to the previos one. Is there a command that I can use to redirect it to a particular page instead of back and will work with both browsers.
Dont really wanty to go to the hassle of PHP.
Not really my strong point I concentrate on Networks (3rd Degree Student), but have not done JavaScript or CSS/HTML. I use Frontpage 2003.