curl

Curl error Could not resolve host: saved_report.xml; No data record of requested type"

<?php error_reporting(E_ALL); $url = 'saved_report.xml'; define('XML_HEADER', '*RWRESPONSE*RESPONSE*DATA*HEADER*COLUMN'); define('XML_ROW', '*RWRESPONSE*RESPONSE*DATA*ROW*COLUMN'); $headers = array(); $rows = array(); function startTag($parser, $data) { global $current_tag; $current_tag .= "*$data"; } function endTa...

cURL ip address

Hi, I need to send a curl request with the user's ip address not the server one. I tried this with no luck: curl_setopt( $ch, CURLOPT_INTERFACE, $ip ); Any ideas? Thanks! ...

How to verify a given string is a real URL, in PHP?

I need to find the best way (in terms of performance) to find if a given string is a URL. REGEXP won't help, as www.eeeeeeeeeeeeeee.bbbbbbbbbbbbbbbb.com is a valid url name but not in any network known to man. I am thinking using CURL and see if I get status 200 back or just file_get_contents and analyze the result. Is there a better way...

USPS API confusion

If anyone has any experience with the USPS delivery confirmation API, I'd really appreciate any insight I can get... I am using PHP and cURL to send an XML request to the D.C. API. When I send the response through cURL, I get nothing. No error response, no XML, or anything. When I send the XML through a browser, I get an error respon...

How to parse dict output in a user friendly way in PHP?

Hi, I am trying to implement a dictionary-type service. I send a request with php using cURL to dict.org with the dict protocol. This is my code (which on its own works and may be helpful for future readers): $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "dict://dict.org/define:(hello):english:exact"); curl_setopt($ch, CURLOPT_RETURN...

Set Authorization header using PHP and curl

We're using Commission Junction's REST service, which requires we sent an API key in the Authorization header. We set the header like this: $ch = curl_init(); curl_setopt_array($ch, array( // set url, timeouts, encoding headers etc. CURLOPT_URL => 'https://....', // ... )); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authoriz...

cURL: https through a proxy

I need to make a cURL request to a https URL, but I have to go through a proxy as well. Is there some problem with doing this? I have been having so much trouble doing this with curl and php, that I tried doing it with urllib2 in Python, only to find that urllib2 cannot POST to https when going through a proxy. I haven't been able to ...

How to use the Google SpreadSheets API to feed data to an application?

I've read through the Google Spreadsheets API PHP documentation. All examples are using Zend, which I cannot use. See this page: http://code.google.com/apis/spreadsheets/docs/1.0/developers%5Fguide%5Fphp.html Does anybody know a simple example of the following: How can I use PHP w/ curl (or whatever) and the Google Spreadsheets API to ...

How do I use cURL/PHP to dump the current twitter trending topics into mySQL

Trying to run a cron job every few hours that reads the current Twitter Trending topics listed here: http://search.twitter.com/trends.json And then dump the top 10 trends into a mySQL table on my server how to do this? thanks ...

jQuery AJAX post not working, but works with curl

Hi there, I'm trying to make a post request via ajax using jQuery (for the BaseCamp API), and I can't seem to get it to work. I can get it to work using curl just fine, so I know it's something I'm doing wrong with jQuery. Here's the curl command which works: curl -H "Accept: application/xml" -H "Content-Type: application/xml" -u my....

What to use if i want to repeat set of parameters in php libcurl session

I'm trying to do multiple things in curl and obviously some parameters in each step will be the same... should i use curl copy handle or curl setopt array? As far as i understand both do the same thing... or i'm getting something wrong? ...

mySQL query fails when read from file or web

This is driving me nuts! I have created a query. The query is written to Windows file for future connection to the remote database. Upon the connection using cURL, my local script uses cURL to send the query. I assemble variables using build_http_query. The cURL works just fine but the query fails. Every time. mySQL complains that qu...

Get an html page as image in php from an url (like printscreen)

I need to get a "thumbnail" of a web page which I know the url and save it to a file. At the moment i'm stuck at "conversion" from html to image: i can get the html via curl. How can i do to achieve this in php? It's possible? ...

CURL and HTTPS, "Cannot resolve host"

I'm trying to fetch the contents of a page using CURL. The page that is doing the fetching is https and the page it is trying to fetch is also https. I'm getting an error "Couldn't resolve host" with all of the settings I try. $c=curl_init(); curl_setopt($c, CURLOPT_URL,$url); //curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows...

How to get CURL to work with PHP on Windows? (WAMP)

Update: The problem appears to have been corrupt DLLs somewhere in my PHP installation, or possibly a bug in PHP 5.2.9 on Win2k. I downloaded the windows (binaries-only) distribution of PHP 5.2.10 from php.net and extracted that to my c:\PHP directory. After doing that, everything worked fine. Update2: I undid everything that I tried ...

How to Enable curl in PHP

Could any body tell me How to Enable curl in PHP Thanks in Advance Fero ...

php libcurl alternative

Are there any alternatives to using curl on hosts that have curl disabled? ...

Need help with libcurl username/password authentication.

I'm trying to access a secure webpage on one of our servers. The webpage is inside a .htaccess protected directory that requires a username and password. I'm trying to get libcurl to submit the authentication request so it can access the file. After finding some guidance in various places, I've come up with what I believe should work,...

Possible to add data to the body of a HTTP request using cURL in PHP?

I would like to add some data to the body of a http request using cURL in PHP. Is this possible? How? I'm sending a HTTP request to a remote server. I have added all the headers I want, but now I need to add some more data to the HTTP body but I cant figure out how to do it. It is supposed to look something like this: Host: stacko...

cakephp data validation before posting remote form

This one is really racking my brain: I need to post non-sensitive data to a third party payment gateway. I want to use the built in cakephp form validation which is working fine. What i am doing is submitting the form to a local action which calidates the data and outputs any errors if there are any. Where i am stuck is trying to re-sub...