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.
Results 1 to 2 of 2
  1. #1
    Regular Coder StealthRT's Avatar
    Join Date
    Aug 2006
    Posts
    187
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Exclamation iFrame and reading it's code and posting outside of the iframe

    Hey all i am trying to figure out how to load the contents of an iframe code into the main page.
    Code:
    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

  • #2
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    Sounds like a job for ajax
    You can not say you know how to do something, until you can teach it to someone else.


  •  

    Posting Permissions

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