I am using a log in script and need some help please:
This script logs in users wuth a user name and password to a spacific page. it works just fine. Hoever whn you have loged in you can save the page and go back to it any time. I have tried to stop unwanted uses from access this page by using another script to redirect them to the login page before they can view the page they want the script is called "Must Visit From".
Here is the login script I am using:
I need it to work from a log in java script here is the script it is logging in from
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="masters" && password=="master") { window.location="http://www.lcdsecurity.com/test/testpage.html"; done=1; }
if (done==0) { alert("Invalad! Username or Password !");}
}
// End -->
</SCRIPT>
Please note it woks just fine on its own. But when I use the rediret scrip on the page I want blocked using the Must Visit From script it redirects me to the login page constantly and it does not recognize the it is the referring page.
Here is the Must Visit From script I am using.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var requiredfrom = "http://www.lcdsecurity.com/test/sample.html"; // required prev. page
if (document.referrer.indexOf(requiredfrom) == -1) {
alert("Your Access is Denied ! You must Login before you can visit this page ! " );
window.location=requiredfrom;
}
// End -->
</script>
I need the redirect scrip to be able to know that when someone loggs in they are comming from the refferd page.
I appreciate all you help.
Kind regards Larry
This script logs in users wuth a user name and password to a spacific page. it works just fine. Hoever whn you have loged in you can save the page and go back to it any time. I have tried to stop unwanted uses from access this page by using another script to redirect them to the login page before they can view the page they want the script is called "Must Visit From".
Here is the login script I am using:
I need it to work from a log in java script here is the script it is logging in from
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="masters" && password=="master") { window.location="http://www.lcdsecurity.com/test/testpage.html"; done=1; }
if (done==0) { alert("Invalad! Username or Password !");}
}
// End -->
</SCRIPT>
Please note it woks just fine on its own. But when I use the rediret scrip on the page I want blocked using the Must Visit From script it redirects me to the login page constantly and it does not recognize the it is the referring page.
Here is the Must Visit From script I am using.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var requiredfrom = "http://www.lcdsecurity.com/test/sample.html"; // required prev. page
if (document.referrer.indexOf(requiredfrom) == -1) {
alert("Your Access is Denied ! You must Login before you can visit this page ! " );
window.location=requiredfrom;
}
// End -->
</script>
I need the redirect scrip to be able to know that when someone loggs in they are comming from the refferd page.
I appreciate all you help.
Kind regards Larry