curl

How to get the headers from the last redirect with PHP's curl functions?

If I execute a cURL request that is set to follow redirects and return the headers, it returns the headers for ALL of the redirects. I only want the last header returned (and the content body). How do I achieve that? ...

How do I find out what was sent with cURL?

I'm trying to figure out why a cURL process (written in PHP) that used to be working is no longer working. I'm receiving the same data back as what an actual browser is receiving, but I'm not sure if I'm sending the same information as the browser. Is there a way I can find out what the cURL library in PHP is sending? Note: I don't hav...

Why is this returning a "Not Found" with PHP and cURL?

My script works with all other links I tried, and i get the same response with cURL also (and this is a lot smaller, so I like this code): <?php $url = $_GET['url']; $header = get_headers($url,1); print_r($header); function get_url($u,$h){ if(preg_match('/200/',$h[0])){ echo file_get_contents($u); ...

Using CURL with oauth for desktop-couch

To access desktopcouch the documentation suggest to use oauth. Using the samples in the O'Reilly book "CouchDB - the definite guide" I want to use CURL (or another command line tool if appropriate) to work with desktopcouch. I guess I would need a script to query the key store to retrieve the oauth token and add it to the CURL string. Id...

Scrape a website URL to get the path of an image

I'm hacking together a simple php script that will build a list of photo albums I have on my Facebook fan page. Facebook kindly offer the Graph API which gives me back a nice list of Albums, however they no longer provide the path of the default album image. I want to write a PHP script that loads an album url via curl and somehow grab...

Handling errors with curl_multi_exec

Hello, My question revolves around the use of curl_multi_exec in PHP. I am using code similar to the example shown on this link: http://www.rustyrazorblade.com/2008/02/curl_multi_exec/ With about 10 URLs to execute, I sometimes come across the error message: Fatal error: Maximum execution time of 30 seconds exceeded in... This message ...

How to create a http response for a request associated with a different PHP session?

Hello there, Is it possible to create a http response for requests associated with a different PHP session? If so, how to do that? I'm creating a script language to make it easier for PHP developers to handle phone interactions. My application receives phone calls and then activates the user scripts associated with those calls. Scrip...

How can I extract the title and description of a TED.com video?

I have a project that I need to add many many videos, some of which are TED.com videos. Is there an easy way I can perform an AJAX, JSON, or cURL request to obtain this information? This information does not seem to be in the embed object. ...

SMF curl login issue php

Does any one have have some PHP login curl code for SMF version 1.1.11 I tried and it logs then when I check the curl output, but when the broswer loads, they are no longer logged in My code function login($data) { if(function_exists('curl_init' )) { $_SESSION['old_url'] = $_SERVER['HTTP_HOST'] .'test'; // smf nee...

Curl giving "Invalid UTF-8 JSON" error from CouchDb although JSON is fine? Any ideas?

This is slightly different from the question titled "Error about ‘invalid JSON’ with couchDB view but the json’s fine": I am not trying to upload a file only enter a simple document. The example I am trying to use is actually from O'Reilly's book "CouchDB: The Definitive Guide" and I am pretty sure that I have tried it before and got i...

CURL vs fsockopen chunking

This may seem kind of weird.. but I need to evaluate/parse chunks being sent over HTTP with PHP. It's of note to say that the HTTP stream may never end. Is there any way I can parse chunks as I get them with CURL? Or do I have to resort to some home-brewed fsockopen() solution? ...

Does the Tumblr write API require encoding on the 'body' of a post?

Hi guys, I'm trying to implement the Tumblr API into an app. I've hacked together their OAuth implementation but I'm having an issue with their write API. When I send a post body with no spaces in, it posts correctly. But if there is a space, I receieve an 'Invalid Oauth parameters'. Below is a rough example - I hope someone can help!...

How do I directly upload a file stream to Flickr using a CURL POST?

I'm writing a web app that at one point allows a user to upload a photo to a flickr account (mine). I want to do this without saving the intermediate image on the server my web app is on. What I've got so far is a page which implements phpFlickr and accepts a POST from a simple html form. I use $_FILES['file']['tmp_name'] as the path f...

How can I parse flashvars from string

How can I parse the flash vars from a string like this? <script type="text/javascript"> flashvars.added = "2010-07-18"; flashvars.name = "testing+purposes"; flashvars.user = "jhon+doe"; </script> I am using curl to get the string. ...

curl_init missing after Macports php5 install

I have a Macports installed version of php5, that is missing the curl extension. phpinfo shows /opt/local/etc/php5/php.ini as the location for php.ini, with one of the additional .ini files listed as /opt/local/var/db/php5/curl.ini The contents of curl.ini: extension=curl.so If I do a locate curl.so I get /opt/local/lib/php/extensions...

Skip SSL Check in Zend_HTTP_Client

All, I am using Zend_HTTP_Client to send HTTP requests to a server and get response back. The server which I am sending the requests to is an HTTPS web server. Currently, one round trip request takes around 10-12 seconds. I understand the overhead might be because of the slow processing of the web server to which the requests go. Is i...

CURL working from localhost but not on live site

I have a CURL code that fetches some XML content from a remote server. I get the expected output on my localhost (XAMPP on windows). But from the live site(hosted on Linux), I get the CURL error:'couldn't connect to host'. function DownloadUrl($Url, $p){ // is curl installed? if (!function_exists('curl_init')){ die('CURL is not...

how to click a link using cURL.?

for example, in a web page many links are given. forward backward take this two as two links. i want to first to load this page, wich contains this links and click on any of those links. NOTE[i dont know the URL thats gonna load after i click it as it randomly changes] ...

php cURL , fill a remote form

Hi, is it possible to fill a remote form with the desired data ? Remote form <input type=text name=uploads[0] id=attachId0 size=30 onchange="checkUploadFile(this);"><input type=button value="del" id=idAttachOper0 onclick="return delInput('idfilespan','0')"><br id=idAttachBr0> ...

compiling cURL with SSL support - Fedora 11

Hi All! I'm new to Linux/Fedora (and I'm using Fedora 11 because I need PHP 5.2 and don't know how to "downgrade" on later versions of the OS) so keep that in mind while you read. I'm currently trying to enable cURL on my Fedora 11 install in order to use an NTLM authentication payment gateway from my machine. I've seen it work on box...