curl

Passing a parameter in the header (XML RPC)

I'm trying to set up a server status for the MMORPG Champions Online. I got some basic information from the web master and this is all he told me: XML-RPC call to server: http://www.champions-online.com/xmlrpc.php function name: wgsLauncher.getServerStatus Parameter (language): en-US Now, I found a nice example to start with here, a...

Posting a textarea form with cURL

How would I go about posting a textarea form? <form method="post" action="/user/test/shoutbox/add" id="shoutPost" class="clearit"> <input name="formtoken" type="hidden" value="852f8fde54190fa5f9aa47172d492f829c1b"/> <input type="hidden" name="backto" value="/user/test/shoutbox" /> <textarea id="shoutmsg" name="message"></textarea> <inpu...

How do I Parse the response I get back from CURL?

I'm sending some data to an external URL using Curl. The server sends me back a response in a string like this: trnApproved=0&trnId=10000002&messageId=7&messageText=DECLINE I can assign this string to a variable like this: $txResult = curl_exec( $ch ); echo "Result:<BR>"; echo $txResult; But how do I use the data that is sent back?...

Get modified date via FTP using PHP / CURL

I seem to be running into a documentation drought with CURL vs FTP, can anyone tell me how to get the last modified date of a given file using PHP / CURL. Many thanks! ...

Trying to login to site with PHP & cURL?

I've never done something like this before...I'm trying to log into swagbucks.com and get retrieve some information, but it's not working. Can someone tell me what's wrong with my script? <?php $pages = array('home' => 'http://swagbucks.com/?cmd=home', 'login' => 'http://swagbucks.com/?cmd=sb-login&amp;from=/?cmd=home', ...

curl POST to RESTful services

Hello All, There are a lot of questions on Stackoverflow about curl but I could not figure out what is that I am doing what I am not supposed to. I am trying to call a RESTful service that I had written using Jersey API and am trying to POST an xml string to it and I get HTTP 415 error which is supposed to be a Media Type error. Here i...

Determine between files and folders using cURL

I'm writing a script to download files from an FTP server using cURL + PHP, at the moment I am just trying to build a complete file structure, here's the code I'm using so far: <?php $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "ftp://www.example.com"); curl_setopt($curl, CURLOPT_USERPWD, "user:pwd"); curl_setopt...

using libcurl to check if a file exists on a SFTP site

I'm using C++ with libcurl to do SFTP/FTPS transfers. Before uploading a file, I need to check if the file exists without actually downloading it. If the file doesn't exist, I run into the following problems: //set up curlhandle for the public/private keys and whatever else first. curl_easy_setopt(CurlHandle, CURLOPT_URL, "sftp://user@...

PHP4 HTTP Post without cURL

I have the following code that works on PHP5 to send a HTTP POST without using cURL. I would like this to work on PHP 4.3.0 and above: $opts = array('http' => array( 'method' => 'POST', 'header' => "Content-type: application/x-www-form-urlencoded\r\n" . "Content-Type: application/json\r\n", 'content' => $q...

Monitor AJAX calls via cURL

Is it possible to monitor a page's AJAX calls via cURL in PHP? For example, if I connect to a website that uses lots of AJAX to pull content, can I connect to the site via cURL, have it wait a couple of seconds until the AJAX requests are done and analyze the request that the site made? ...

Has anyone experienced curl request inconsistencies?

I'm trying to request a url but it fails and when I var dump the result of curl exec it returns false. http://mydomain.com:8807/getstate/?zipcode=22311&amp;field=statecode In the browser I can access it and it returns the correct HTTP Content Body, Content Type is text/html. If I change it to: http://mydomain.com:8807/getstate/?zipco...

Count # of links programmatically

Is there a way I can programmatically count the number of links for a website? Does google provide an api that can I can programmatically query? ...

IMDB Grabber PHP

I am recieving an error: Notice: Undefined variable: content in C:\wamp\www\includes\imdbgrabber.php on line 17 When using this code: <?php //url $url = 'http://www.imdb.com/title/tt0367882/'; //get the page content $imdb_content = get_data($url); //parse for product name $name = get_match('/<title>(.*)<\/title>/isU',$imdb_content);...

follow of curl for java

i want how to follow the link... for example the link : http://example.com/hi.php this will redirect another page to http://example.com/vi.php then this will redirect another page to http://example.com/ji.html so i need to get the page link "http://example.com/ji.html" i think, i cant in java.. so have possible in java curl? thank...

Problem PHP with cURL

hi i have a problem with cURL and php. I use an API and i want to display only the results. Here is my php + curl script <?php $file = "http://api.openkvk.nl/php/".rawurlencode("SELECT * FROM kvk WHERE kvks='20147376'"); $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt...

Handling large PUT requests in ASP.NET

Hello, I'm far from an ASP.NET specialist so I was wondering what the best way to handle this was: I need to upload potentially large files to an ASP.NET application by a cURL client (i.e. an HTTP PUT request) I need to validate the user identity as well as other header information early in the process in order to reject invalid connec...

Unknown Curl error

Hey i got small problem getting an unknown curl error from my script "curl_error(): 180 is not a valid cURL handle resource". Im not able to find any recourses about that error so maybe anyone has any experience with this. Thanks already. Heres the part which causes the error and exact log: PHP Warning: curl_error(): 180 is not a vali...

curl follow location error

Hi, I got this error message: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in. safe_mode is turned off on my web hosting. open_basedir is "". How do I resolve this? Thanks ...

how to know which response data is associated with its requested url (in RollingCurl.php) ?

I am writing a web application that grabs (in parallel) the http response headers from multiple sites (with RollingCurl) then stores it in an array and at the end outputs it in JSON format. Since some sites do redirects to new locations, $info (array) in “request_callback” function always contains an url ($info[‘url’]) where the request...

Why do I get a connection error / timeout when using python suds to connect to Microsoft CRM?

When I try to connect to an MS CRM web service using suds/python-ntlm, I am getting a timeout on requests. However, the code that I'm trying to replace -- which calls out to the cURL command line app to do the same call -- succeeds. Clearly something is different in the way that cURL is sending the command data, but I'll be damned if I...