Can't send with cURL in PHP -


i created test host on 0fees.net. create small php script receive file wish send.

i tried lot of things server responds http 403 forbidden; actual message in verbose output is

* connect() ********* port 80 (#0) *   trying 209.190.85.12... * connected * connected ******* (209.190.85.12) port 80 (#0) > post /index.php http/1.1 host: ************* accept: */* content-length: 791 expect: 100-continue content-type: multipart/form-data; boundary=----------------------------4cad4df8 02c5  * requested url returned error: 403 * closing connection #0 * http response code said error 

the code use is

curl_easy_setopt(curl, curlopt_url, link); curl_easy_setopt(curl, curlopt_header, "user-agent: mozilla/5.0 (windows nt 6.1) applewebkit/534.30 (khtml, gecko) chrome/12.0.742.30 safari/534.30"); curl_easy_setopt(curl, curlopt_verbose, 1); curl_easy_setopt(curl, curlopt_failonerror, true); curl_easy_setopt (curl, curlopt_followlocation, 1l); curl_easy_setopt (curl, curlopt_post, 1); curl_easy_setopt(curl, curlopt_cookiefile, ""); curl_easy_setopt(curl, curlopt_httppost, formpost); curl_easy_perform(curl); 

most of curlopts stuff added because aforementioned http 403 error. how can resolve this?

p.s code works flawlessly on localhost setup!

403 forbidden means you're sending request either using wrong method or wrong url.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -