and it does the right thing when I enter the right password..
But does not bring back to dump if I enter wrong password... it just takes me (as intended by the original code) to /Codebox/wrongpassword.html
The problem here is, a wrong password can be any thing and the code contend in the pop up box does not know when it opens, what password the user is going to enter.
I know I am not understanding the code. Here is the file arrangement. Webroot
-index.html (the homepage)
-dragto.html ( refered to as dump)
-gate.html (the pop up )
-Codebox
--xyz.html (refered to as treasure)
Please suggest what should the code be which I need to put in the pop up (gate.html).
Erm.. I see that you have kept your original script and just added mine as a completely independent script . You've even kept my reference to non-existent carousel, etc., pages - so no wonder it won't work.
You need to combine my script with yours - that is, with your goForit() function. If you have no idea how to do this then I can't help you any further and perhaps you should consider hiring someone to do this for you.
Good luck. Andy.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
Last edited by AndrewGSW; 12-10-2012 at 10:27 PM..
I will figure it out. Thank you for the heads up. I am sincerely thankful for your help. Will ask you if I run into any problem with this code. Thank you.
Well, seeing as it's Christmas, this will be nearer (its the code for the pop-up):
Code:
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>Match 2014 Secret Documents</TITLE>
<script type="text/javascript">
////////////////////////////////////////////////////////////////////
/// Get your very own Gate Keeper from Professional Web Design ///
/// http://junior.apk.net/~jbarta/weblinks/gate_keeper/ ///
////////////////////////////////////////////////////////////////////
var password = '', newLocation;
var oIframe;
window.onload = function () {
oIframe = document.getElementById("secretIframe");
oIframe.onload = function () {
// for compatibility
var oDoc = oIframe.contentWindow || oIframe.contentDocument;
if (oDoc.document) {
oDoc = oDoc.document;
}
var newLoc = oDoc.location.href;
if (newLoc.indexOf(password) + 1) {
// alert('Yes, it is the correct page!');
fetch(newLocation);
theKeeper = window.close();
} else {
// 404 - out of luck!
opener.location.href = "dump.html";
theKeeper = window.close();
}
};
};
function goForit() {
password = this.document.testform.inputbox.value;
newLocation = 'Codebox/'+ password + ".html";
oIframe = document.getElementById("secretIframe");
oIframe.src = newLocation;
}
function fetch(locn) {
var root;
if (opener.closed) {
root = window.open(locn,'theKeepersGopher','height=500,width=400,left=100,top=100,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no');
} else {
opener.location.href = locn;
}
}
// End hiding --->
</script>
</HEAD>
<BODY>
<iframe id="secretIframe">Hello</iframe>
<FONT FACE="ARIAL" SIZE=2 color="#000"><B>password xyz for treasure for any other password you will be taken to dump</B></FONT><BR>
<CENTER>
<FORM NAME="testform" action="" method="get">
<INPUT TYPE="password" NAME="inputbox" VALUE="" size=20 class="pass"><p>
<INPUT TYPE="button" NAME="button" Value="get treasure" onClick="goForit(this.form)" class="button">
</FORM>
</CENTER>
</BODY>
</HTML>
It assumes a page called dump.html exists, as you suggested previously. I haven't tested it in combination with the main page.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
I really appreciate your help Andy. I used the above code for the popup and I feel I am almost there. I can see the pop up box load the page after clicking submit in the password form. And as expected it does close itself after opening the page in the main window too. But the page it opens in the main window is not the dump.html (which is present in the root)rather it takes to the /Codebox/wrongpassword.html I have implemented it here https://dl.dropbox.com/u/25512757/Sand-Box/index.html
I don't want to bother you with this, And I appreciate your time and effort. I would still appreciate it even if you drop this out now. Thank you...
Last edited by Mayankode; 12-11-2012 at 12:09 AM..
It won't work from dropbox or locally - it should work from a server (probably..).
When the wrong password is entered it doesn't have a 404 page to display, so the address bar still contains 'wrongpassword' - so it thinks the right password was entered.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
The whole thing boils down to the absence of a 404page...
I just uploaded them to the server in google appengine.. but like I was saying in the other post the errors are displayed with some gibberish error codes and it actually does not reach a 404 page. The page address remains the same.
So this did not work in the server too. And it will not work until I fix the definable 404page issue. Once I set it up, This pop up code will work like a charm I think. You have been very kind to me. And I appreciate that. Please do not worry about this. I will have it figured out by some friend of mine some time later.
No worries. You could delete (temporarily) that stuff in your config-file, just leaving the redirection at the bottom to your own 404 page. Andy.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS