header


  
      function set_request_headers()
      {
          headers  = "{_SERVER['REQUEST_METHOD']} {this->url_segments['path']}" . (isset(this->url_segments['query']) ? "?{this->url_segments['query']}" : '') . " HTTP/1.0\r\n";
          headers .= "Host: {this->url_segments['host']}:{this->url_segments['port']}\r\n";
          headers .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n";
          headers .= "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1\r\n";
          headers .= "Connection: close\r\n";
  
          if (this->flags['show_referer'] == 1)
          {
              headers .= "Referer: {this->url_segments['base']}\r\n";
          }
  
          cookies  = this->get_cookies();
          headers .= cookies != '' ? "Cookie: cookies\r\n" : '';
  
          if (_SERVER['REQUEST_METHOD'] == 'POST')
          {
              this->set_post_body(_POST);
  
              headers .= "Content-Type: application/x-www-form-urlencoded\r\n";
              headers .= "Content-Length: " . strlen(this->post_body) . "\r\n\r\n";
              headers .= this->post_body;
          }
  
          headers .= "\r\n";
  
          this->request_headers = headers;
      }