Getting the URL address from an IFrame on my site with PHP -


i have simple iframe of site in site:

     <iframe name="frame1" src="http://www.walla.co.il" width="100%" height="400"></iframe> 

that site doesn't belong me in way. looking way go exact url address of site , post echo viewers see address of site on site. found scripts online didnt seem work.

is possible it? looking way echo variable (something echo $url;)

this i've tried far:

    <iframe name="frame1" src="http://www.walla.co.il" width="100%" height="400"></iframe>      <?php     $htmlpage = file_get_contents("http://www.walla.co.il"); //the page has iframe      if(preg_match_all("/<iframe[^>]*name=\"frame1\"[^>]*src=\"([^\"]+)\"[^>]*>/i", $htmlpage, $matches))     {         print_r($matches);         echo $matches[1][0];     }     ?> 

yeah can that:

$htmlpage = '<iframe name="frame1" src="http://www.walla.co.il" width="100%" height="400"></iframe>'; //the page has iframe  if(preg_match_all("/<iframe[^>]*name=\"frame1\"[^>]*src=\"([^\"]+)\"[^>]*>/i", $htmlpage, $matches)) {     //print_r($matches);     echo $matches[1][0]; } 

this not tested though...

edit: don't know trying accomplish in here can't that. html string of iframe should inside variable. see updated answer...


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -