php - curl not working for getting a web page content, why? -
I am using a curl script to go to a link and getting it to manipulate its contents more I am The following is the link and curl script:
But through the website script is not leaving it, which resulted in giving the user exception, but if we paste generally URL in the browser's page that properly Opening.
Please help, what am I doing wrong here.
Thanks and relation
I run the following program / script and download the page properly It was most likely that the server from which you are running your script can not access the server on "criminally.state.nos." This is because your server is misconfigured, or their server is clearly blocking you, which is a common result of aggressive screen scrapping.
& lt ;? Php $ url = "http: / /kriminljustiskstetknykus/sgi/intrnet/nzr/fortekgi?sservisename=vebnsor∓templtnme=ditelkhtm∓rekvestinghandlr=vebnsordetailhndler∓id=368343543; $ Ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, $ url); 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, incorrect); Curl_setopt ($ CH, CURLOPT_FOLLOWLOCATION, true); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, true); $ Result = curl_xac ($ CH); Curl_close ($ ch); $ Return result; Additional troubleshooting tips - if your machine has shell access to your PHP script is running, run the following command curl-I 'http: //criminaljustice.state.ny.us/ Cgi / internet / nsor / fortecgi? ServiceName = WebNSOR and templateName = detail.htm and Anurodhandlr = WebNSordetailHandler & id = 368343543 '
When will it generate response headers, which can be a signal that why your request was unsuccessful.
Comments
Post a Comment