...

View Full Version : Extracting values from iframe



holyearth
05-12-2007, 02:14 AM
Hello,

I've got a page which is setup as follows:

<head>
header stuff
</head>
<body>
body stuff

<iframe>http://www.redirects3hopstofinalurl.com</iframe>

<INPUT TYPE="hidden" name="num" value="COMES FROM THE IFRAME">
</body>

The iframe has 3 hops which it redirects thru and then it lands at a page with the following type of URL http://www.thisisthefinalurl.com/?num=44548ds89

I need javascript to pull the num value of the final redirect page of the iframe and stick it into the value= parameter of my input...

Here's a real world example......


<iframe>http://www.example1.com</iframe>

<INPUT TYPE="hidden" name="num" value="327dsdds32">

In that example here is what happened with example1.com ... it went to example2.com then landed at example3.com/?num=327dsdds32 ... when it was done redirecting the script will have retreived the num= value from the effective iframe url.

Please let me know if this is confusing and/or if you need clarification...

Thanks in advance for your time and help!!!

holyearth
05-12-2007, 02:42 AM
Is it possible to extract the iframe's final URL as follows:

var currentUrl = top.iframe.location.href;

??

_Aerospace_Eng_
05-12-2007, 03:16 AM
Only if the url is on your own server. If its on a different server then no its not possible.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum