novtu89 Posted November 30, 2014 Share Posted November 30, 2014 Hello, I try to get website speed of some website, but i can read only ''domain.com'' i can't read website files like css , js ... why ? i use proxies for this job. here is the php code: $options = array( 'useragent' => "Firefox (+http://www.firefox.org)", // who am i 'connecttimeout' => 120, // timeout on connect 'timeout' => 120, // timeout on response 'redirect' => 10, // stop after 10 redirects 'referer' => "http://www.google.com", 'proxyhost' =>'85.25.8.14:80' ); $response = http_get("http://solve-ict.com/wp-content/themes/ict%20theme/js/jquery-1.7.1.min.js", $options , $info); but it works fine with http://domain.com/ , but with files css or js it gives 404, using some free proxy servers available ? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/292808-try-to-get-website-speed-but-i-can-read-only-domaincom-i-cant-read-files-like-css-js-why/ Share on other sites More sharing options...
QuickOldCar Posted November 30, 2014 Share Posted November 30, 2014 No idea why, but if just need the speed of the connection transfer can use this I would use curl for the connection. Do you really want a 120 second timeout? <?php $url ="http://solve-ict.com/wp-content/themes/ict%20theme/js/jquery-1.7.1.min.js"; $start_request = microtime(true); $data = @file_get_contents($url); $end_request = microtime(true); if(!$data){ echo 'Timed Out'; } else { echo $time_taken = round(($end_request - $start_request),2); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/292808-try-to-get-website-speed-but-i-can-read-only-domaincom-i-cant-read-files-like-css-js-why/#findComment-1498142 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.