php - Parsing curl links and point to own server -
i'm trying set basic proxy script pull external contents , execute scripts on them. bypass same origin policy, i'm using curl fetch contents
<?php $url = 'http://www.mozilla.org'; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_useragent, "mozilla/1.0"); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer, true); $result= curl_exec ($ch); curl_close ($ch); echo $result; ?>
however doesn't fetch css + images etc. inserted 'base' reference points original source
echo '<base href="http://www.mozilla.org"/>';
my question is, methods should use parse of css, img, , other js links on each page of pulled external content, url should like:
http://mydomain.com/curl.php?url=http://www.mozilla.org/main-page.html/ http://mydomain.com/curl.php?url=http://www.mozilla.org/main-page.html/sub-page.html
thanks
Comments
Post a Comment