Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    New Coder
    Join Date
    May 2011
    Posts
    27
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I have replaced the carousel code with

    oIframe.src = "Codebox/" + password + ".html";

    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).

    I think I am confused about the not-carousel.html in the code. Please help
    Here is the link with the implemented code. https://dl.dropbox.com/u/25512757/Sand-Box/index.html

  2. #17
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    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.
    Last edited by AndrewGSW; 12-10-2012 at 11:27 PM.
    "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

  3. #18
    New Coder
    Join Date
    May 2011
    Posts
    27
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I was thinking the same. I wish I could merge it.

    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.

  4. #19
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    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>
    &nbsp;
    
    
    <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

  5. #20
    New Coder
    Join Date
    May 2011
    Posts
    27
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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 01:09 AM.

  6. #21
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    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

  7. #22
    New Coder
    Join Date
    May 2011
    Posts
    27
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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.

    Heartfelt thanks to you...

  8. #23
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    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


 
Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •