title: curl not working for getting a web page content, why?
body: <p>i am using a curl script to go to a link and get its content for further manipulation. following is the link and curl script:</p>
  
  <pre><code>&lt;?php 
  $url = 'http://criminaljustice.state.ny.us/cgi/internet/nsor/fortecgi?serviceName=WebNSOR&amp;amp;templateName=detail.htm&amp;amp;requestingHandler=WebNSORDetailHandler&amp;amp;ID=368343543';
  
  //curl script to get content of given url
  
  $ch = curl_init();
  
  // set the target url
  
  curl_setopt($ch, CURLOPT_URL,$url);
  
  // request as if Firefox
  
  curl_setopt($ch, CURLOPT_HTTPHEADER, Array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15") ); 
  curl_setopt($ch, CURLOPT_NOBODY, false);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $result= curl_exec ($ch);
  curl_close ($ch);
  echo $result;
  ?&gt;
  </code></pre>
  
  <p>but the website is not excepting it through script it is giving user exception in result, but if we normally paste the url in browser it is opening the page perfectly alright.</p>
  
  <p>Please help, what i am doing wrong here.</p>
  
  <p>Thanks and regards</p>