Note that there are some explanatory texts on larger screens.

plurals
  1. POSome Pictures Don't Load (CSS Problem?)
    text
    copied!<p>i am dynamically loading a website via file_get_contents with the following script.</p> <pre><code>&lt;?php header('Content-Type: text/html; charset=iso-8859-1'); $url = (substr($_GET['url'], 0, 7) == 'http://') ? $_GET['url'] : "http://{$_GET['url']}"; $base_url = explode('/', $url); $base_url = (substr($url, 0, 7) == 'http://') ? $base_url[2] : $base_url[0]; if (file_get_contents($url) != false) { $content = @file_get_contents($url); // $search = array('@(&lt;a\s*[^&gt;]*href=[\'"]?(?![\'"]?http))@', '|(&lt;img\s*[^&gt;]*src=[\'"]?)|'); // $replace = array('\1proxy2.php?url=', '\1'.$url.'/'); // $new_content = preg_replace($search, $replace, $content); function prepend_proxy($matches) { $url = (substr($_GET['url'], 0, 7) == 'http://') ? $_GET['url'] : "http://{$_GET['url']}"; $prepend = $matches[2] ? $matches[2] : $url; $prepend = 'http://h899310.devhost.se/proxy/proxy2.php?url='. $prepend .'/'; return $matches[1] . $prepend . $matches[3]; } function imgprepend_proxy($matches2) { $url = (substr($_GET['url'], 0, 7) == 'http://') ? $_GET['url'] : "http://{$_GET['url']}"; $prepend2 = $matches2[2] ? $matches2[2] : $url; $prepend2 = $prepend2 .'/'; return $matches2[1] . $prepend2 . $matches2[3]; } $new_content = preg_replace_callback( '|(href=[\'"]?)(https?://)?([^\'"\s]+[\'"]?)|i', 'prepend_proxy', preg_replace_callback( '|(src=[\'"]?)(https?://)?([^\'"\s]+[\'"]?)|i', 'imgprepend_proxy', $content ) ); echo "&lt;base href='http://{$base_url}' /&gt;"; echo $new_content; } else { echo "Sidan kan inte visas"; } ?&gt; </code></pre> <p>Now the problem is that some pictures doesn't show in websites. For example those sites who does have CSS links. It is a CSS problem i think. </p> <p>You can test the script here to see what i mean:</p> <p><a href="http://h899310.devhost.se/proxy/index.html" rel="nofollow noreferrer">http://h899310.devhost.se/proxy/index.html</a></p> <p>How can I fix this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload