...

View Full Version : iFrame and reading it's code and posting outside of the iframe



StealthRT
05-03-2009, 01:18 AM
Hey all i am trying to figure out how to load the contents of an iframe code into the main page.


iframe.php

foreach ($contacts as $email=>$name)
{
$counter++;
if ($odd) $class='thTableOddRow'; else $class='thTableEvenRow';
//ADDED LINES
$theNameBoxes.="<input type='text' id='theName-$counter' name='theName-$counter' value='{$name}' onChange='displayNames(this)'>" . "\n";
$theEmailBoxes.="<input type='text' id='theEmail-$counter' name='theEmail-$counter' value='{$email}'>" . "\n";
//END ADDED LINES
$odd=!$odd;
}
}


Main.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<iframe height="250px" width="700px" id="stuffFrame" name="stuffFrame" src="http://xxx.com/phpstuff/iframe.php"></iframe>

</body>
</html>


In the iframe "stuffFrame", there is a list of email address that populate.

I need a way to transfer the $theNameBoxes and $theEmailBoxes code back to the main.html page so that all the text boxes show up on the main page and not just inside the iframe.

Any help would be great!

David

timgolding
05-04-2009, 02:55 AM
Sounds like a job for ajax



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum