Can any help me with this?

User 564439 Photo


Registered User
15 posts

I am using password wizard for protection it works. But what I would like to do is us a simple password button instead of the password wizard since it is a flash app. it will not show on a ipad or mac osx.
My page is protected with this in the head of the page: <script type="text/javascript">
<!--
if (parent.frames.length==0)
window.location.replace("login.html")
//-->
How do I change this to work ? see attached pic.
Thanks
Jeff




Attachments:
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

A txt file would be better.:) I hate typing.:( I'm more of a cut and paste guy.:lol:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 564439 Photo


Registered User
15 posts

Here we go thanks
Attachments:
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

I would take a look at these examples.
http://www.javascriptkit.com/script/cutindex6.shtml
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 564439 Photo


Registered User
15 posts

Those are helpful . But what i am looking for is to be able to direct to the protected page.
protect.html. i configured my page the way you show on your site it works fine using password wizard. But I don't want to use password wizard because it's a swf. doesn't work on ipads.
I would like to use one of the password scripts from that link. I am trying to find the correct code that password wizard generates so it doesn't redirected back to login2.html and will open protect.com.

which follows this:window.location =?????????????????????

I know if i remove the hidden code from the head it will work.

I would like to keep the way you show how to protect the page. is it possible to do it?

I am a novice but learning.

Thank you for sharing your experience. It has been very helpful!

Jeff
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

I altered the script to work for you.:) Don't use this method for anything important as a user can view the source code and see the username and password.:(
You have a page named login.html.
<html>
<head>
<title>login.html</title>
</head>
<body>

<iframe src="password.html" width="1000" height="1000" scrolling="no" frameborder="0">
</iframe>

</body>
</html>


You have a page named password.html
<html>
<head>
<title>password.html</title>
</head>
<body>
<SCRIPT>
function passWord() {
var testV = 1;
var name1 = prompt('Please Enter Your Username',' ');
while (testV < 3) {
if (!name1)
history.go(-1);
if (name1.toLowerCase() == "letmein") {
var testV2 = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV2 < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == "letmein") {
alert('You Got it Right!');

window.location.href=('protect.html');
break;
}
testV2+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1.toLowerCase()!="password" & testV2 ==3)
history.go(-1);
return " ";


var name1 = prompt('Please Enter Your Username',' ');
break;
}
testV+=1;
var name1 =
prompt('Access Denied - Username Incorrect, Please Try Again.','Username');
}
if (name1.toLowerCase()!="username" & testV ==3)
history.go(-1);
return " ";
}
</SCRIPT>
<FORM>
<input type="button" value="Enter Protected Area" onClick="passWord()">
</FORM>
</body>
</html>

You have a page named protect.html
<html>
<head>
<title>protect.html</title>
</head>
<script type="text/javascript">
<!--
if (parent.frames.length==0)
window.location.replace("login.html")
//-->
</script>
<body>
You found my page!
</body>
</html>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 564439 Photo


Registered User
15 posts

Thank you Eric this is great! I appreciate your help.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.