title: Curl - get page with images and css
body: <pre><code>&lt;?php
  function get_web_page($url)
  {
          //echo "curl:url&lt;pre&gt;".$url."&lt;/pre&gt;&lt;BR&gt;";
      $options = array(
          CURLOPT_RETURNTRANSFER =&gt; true,     // return web page
          CURLOPT_HEADER         =&gt; false,    // don't return headers
          CURLOPT_FOLLOWLOCATION =&gt; true,     // follow redirects
          CURLOPT_ENCODING       =&gt; "",       // handle all encodings
          CURLOPT_USERAGENT      =&gt; "spider", // who am i
          CURLOPT_AUTOREFERER    =&gt; true,     // set referer on redirect
          CURLOPT_CONNECTTIMEOUT =&gt; 15,      // timeout on connect
          CURLOPT_TIMEOUT        =&gt; 15,      // timeout on response
          CURLOPT_MAXREDIRS      =&gt; 10,       // stop after 10 redirects
  
      );
  
      $ch      = curl_init($url);
      curl_setopt_array( $ch, $options );
      $content = curl_exec( $ch );
      $err     = curl_errno( $ch );
      $errmsg  = curl_error( $ch );
      $header  = curl_getinfo( $ch,CURLINFO_EFFECTIVE_URL );
      curl_close( $ch );
  
      $header['errno']   = $err;
      $header['errmsg']  = $errmsg;
  
      //change errmsg here to errno
      if ($errmsg)
      {
          echo "CURL:".$errmsg."&lt;BR&gt;";
      }
      return $content;
  }
  print_r(get_web_page('http://google.com'));
  ?&gt;
  </code></pre>
  
  <p>Why in this example i havent images and css? How can i get it? Is simply solution for this? I must add <a href="http://google.com" rel="nofollow">http://google.com</a> before all links, but how?</p>