Hello, I have an iframe in my site, But I want to remove the footer, since that ads bother a lot to my users, its there anyway? Reducing the frame will not help, since the size varies on the day and time, so I will have to change it constantly. If there is any way, please tell me, and if I have to hire someone, I will maybe do. Thanks
If the iframe is from another domain, you cannot do a thing.. You could try adding security="restricted" to disable javascript in the iframe but this only works in IE. Or you could create a scraper in PHP that will fetch the page and remove the footer HTML, then save it locally on your system and update every X minutes. Ofcourse, that all doesn't sound very nice, using the other person's website content without showing his ads.
Can you talk me more about the scrapper thing please? I got this code also <? $headers = "GET /site HTTP/1.0\r\nUser-Agent: name plugin/1.0\r\n\r\n"; $fp = fsockopen("www.site.com", 80, $errno, $errmsg, 30); if($fp) { fwrite($fp, $headers); $resp=""; while(!feof($fp)) { $resp .= fgets($fp, 1024); } fclose($fp); $neck = strpos($resp,"\r\n\r\n"); $head = substr($resp,0,$neck); $body = substr($resp,$neck+4); print $body; } ?> And the footer is included in $body, how can I remove the footer? THANKS!!
Instead of all that you should just use file_get_contents($url) , process it, then save it to disk with file_put_contents (PHP 5..) You'll have to use a regex to remove the part you want with preg_replace.