curl

php curl getting the resources(js,css,etc) of the webpage?

for example when i open http://code.google.com/apis/maps/documentation/examples/geocoding-simple.html for the first time, it doesn't load all the resources right away,but it pulls extra js files after it has loaded. ...

Site login using cURL

I am using cURL for the first time. I need to login to a site and my code is not working. help. i have problem whit setting cookie <?php $cookie_file_path = tempnam('/tmp', 'cookie'); // Login variables $urls = 'http://mypage.php'; $uname = 'user'; $upass = 'pass'; $unamefield = '*****'; $upassfield = '*****'; $usubmit = 'submit'; /...

Using curl with a username and password?

Hi, I want to access a url which requires a username/password basic auth stuff. I'd like to try accessing it with curl. Right now I'm doing something like: curl http://api.somesite.com/test/blah?something=123 so I just get some error back now, I guess I need to specify a username and password along with the above command, how can I d...

Curl automatically display the result?

I'm using php 5.3.2 and when i execute a curl it display the result directly without adding a print or echo function. Here is my code: <?php $pvars = array('query' => 'ice age', 'orderby' => 'popularity'); $timeout = 30; $myurl = "http://www.website.com"; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $myurl); curl_setopt($curl, ...

PHP: Remote file size without downloading file

Is there a way to get the size of a remote file http://my_url/my_file.txt without downloading the file? ...

What is the simplest way to download file in PHP

Hi all, I need to download an image from some URL to my server. However, my server's config disallowed me to do it this way: getimagesize( $file ); Because, it generate error: Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in somefile.php on line 10 So, is there another wa...

Curl_errno=55, "Failed sending network data."

Hi all: I have a php script that updates a database via an api. This script works on one server but not on another. Both servers have curl enabled and they have php 5.2.6 or above. The error happens in the do_put() method. The rest of the script seems to be fine. I have found that: curl_errno= 55 = "Failed sending network data". curl_...

How to send HTTP get method with headers using CURL

Hello , I need to send GET Request method with the below headers . I am getting the following capture from HTTP live headers ***http://172.20.22.26/ GET / HTTP/1.1 Host: 172.20.22.26 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 Accept: text/html,application/xhtml+xml,appl...

php cURL POST how to follow location

Hi Guys, I am in a bit of a rut with a cURL issue. The post works greate, the data is POSTED just fine and received ok, but the url of the posted page never appears in the browser after the cURL session is executed, for example look at the following code: $ch = curl_init("http://localhost/eterniti/cart-step-1.php"); curl_setop...

Get mime type of external file using cURL and php

I've used mime_content_type() and File info but i never successed. i want to use now cURL with PHP and get the headers of the file which is hosted on another domain then extract & determine if the type is MP3 or not. ( i think the mime type of MP3 is audio/mpeg ) Briefly, i know that but i don't know how to apply it :) Thanks ...

Requesting a GZIP'ed page and processing with cURL and PHP

I'd like to make a cURL request that accepts a gzip'ed page. I would then like to unzip the page and process it. I haven't been able to find any ready built examples, so I would like a quick one. Any settings that need to be adjusted, making the actual request, and decompressing the contents. ...

Retrieving the CURL authentication server-side

I'm setting a CURL authentication, using CURLOPT_USERPWD: curl_setopt($curl_handle, CURLOPT_USERPWD, $login); // Authenticate How can I access this value server-side, so I can check it? ...

Recursive FTP directory listing in shell/bash with a single session (using cURL or ftp)

I am writing a little shellscript that needs to go through all folders and files on an ftp server (recursively). So far everything works fine using cURL - but it's pretty slow, becuase cURL starts a new session for every command. So for 500 directories, cURL preforms 500 logins. Does anybody know, whether I can stay logged in using cUR...

Curl connection options

I'd like to know how to check out the speed of a file being uploaded in real time using the curl library in C++. This is what I have written: curl_easy_getinfo(curl,CURLINFO_SPEED_UPLOAD,&c); But the manual says that it shows average speed, but even this doesn't seem to work with me, because I can only see a 0. There is one more thin...

How can I speed up CURL tasks?

I'm using CURL to fetch some data from user accounts. First it logs in and then redirect to another URL where the data resides. My stats showed that it took an average of 14 seconds to fetch some data spread over 5 pages. I would like to speed things up, my questions are: Is it possible to see how much each step takes? Do you know how ...

Translate a webpage in PHP

I'm looking to translate a webpage in PHP 5 so I can save the translation and make it easily accessible via mydomain.com/lang/fr/category/article.html rather than users having to go through google translate. I've found various easy ways to translate text via CURL, however what i'd really like to be able to do is translate an entire webp...

how post a file via curl function in php?

i want to write a script which post a form automatically. it is not a spammer! there is a picture field in form. i want to write the script with php and using curl() function. how can i implement file uploading? and is the php suitable for this purpose? i mean form posting? ...

how auto submit a session based form?

i have a form and want to submit it with a script. i'm going to use curl function in php to do it. but the form is not submit directly. it have 3 steps and at the end of each step it store entered value in session variables and at the final steps it insert record to database with the values are read from sessions. it is possible to do...

XML error: SYSTEM or PUBLIC, the URI is missing when i fetch the data through curl

Can anybody suggest for the same ...

curl function and multipart/form-data issue

does curl function need any special option to post multipart/form-data ? ...