View Single Post
Old 12-10-2012, 01:32 AM   PM User | #11
Mayankode
New Coder

 
Join Date: May 2011
Posts: 27
Thanks: 4
Thanked 0 Times in 0 Posts
Mayankode is an unknown quantity at this point
@Andy

I am not sure.. When I put the code in the popup then it shows a messagebox in the pop up itself, as soon as it loads and on clicking ok, takes me to the dump (dragto.html)... but the user never gets to input the password...

Here is the file structure I am using

Webroot
-index.html (the homepage)
-dragto.html ( refered to as dump)
-gate.html (the pop up )
-Codebox
--xyz.html (refered to as treasure)


The desired behavior is on clicking a button in index.html it opens the gate.html as a pop up. Then if you put xyz as the password in the popup, it takes you to /Codebox/xyz.html but entering anything else should take you to dragto.html.

The codes of pages without your code are the following.

Code of Index.html
Code:
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>The Home Page</title>
<SCRIPT LANGUAGE="javascript">
                <!--- Hide from tired old browsers
                var nifty_little_window = null; 
                function gateKeeper() {
				nifty_little_window = window.open('gate.html', 'theKeeper',
                'width=390,height=200,top=450,left=500,resizable=no');
                }
                // End hiding --->
                </SCRIPT>
</head>
<body>
<div>
<h1>This is the homepage</h1></br><h2>If you enter password xyz in the following pop up you will get the trasure</h2></br><h3>giving any other password will take you to the Dump page</h3>
</div>


<form>
<input type="button" value="Submit" onClick="gateKeeper()" class="button">
</form>	
</body>

The code of gate.html

Code:
<HTML>
<HEAD>
<TITLE>Match Documents</TITLE>

<SCRIPT LANGUAGE="JavaScript">
function goForit() {
  var location;
  var password;
  password=this.document.testform.inputbox.value
  location='Codebox/'+password + ".html"
  fetch(location)
  theKeeper=window.close()
}

function fetch(location) {
  var root;
  if (opener.closed) {
    root=window.open('','theKeepersGopher','height=500,width=400,left=100,top=100,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no');
    root.location.href = location;
  } else {
    opener.location.href = location;
  }
}

// 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">
<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>
Sorry for pasting crude codes... right now if you go to the https://dl.dropbox.com/u/25512757/Sand-Box/index.html I have added your code in the pop up and it is not functioning desirably... Here are all the files you can test easily https://dl.dropbox.com/u/25512757/Sand-Box.rar Please guide me... Thank you...
Mayankode is offline   Reply With Quote