Tag Archives | CURL

PHP: Example of usage CURLOPT_WRITEFUNCTION

CURLOPT_WRITEFUNCTION: A callback accepting two parameters. The first is the cURL resource, and the second is a string with the data to be written. The data must be saved by this callback. It must return the exact number of bytes written or the transfer will be aborted with an error. Result: Example 2:

Read full story Comments { 1 }

PHP: Example of usage CURLOPT_HEADERFUNCTION

If you set option CURLINFO_HEADER_OUT to true, you can get request header with function curl_getinfo (see example 2) CURLOPT_HEADERFUNCTION: A callback accepting two parameters. The first is the cURL resource, the second is a string with the header data to be written. The header data must be written by this callback. Return the number of […]

Read full story Comments { 0 }

PHP: how to get content of many websites in the same time

The solution is CURL, this is powerful tool to do it. Here’s the plain example, you can know how to get content of many websites in the same time: Result: PHP code of get1.php,… Online demo: http://demo.tutorialspots.com/curl/curl_multi.php

Read full story Comments { 0 }

How to install curl in Cygwin

Curl is a tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, TELNET, DICT, FILE and LDAP. Curl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunneling and a busload of other useful tricks. Dependencies: – Cygwin […]

Read full story Comments { 0 }

PHP & CURL: step by step – HTTPS Source grabber

Example 3: HTTPS Source grabber Result: Note:

Read full story Comments { 0 }

PHP: Facebook SDK – SSL – CURL doesn’t verify a certificate

PHP: Facebook SDK – SSL – CURL doesn’t verify a certificate If we use Facebook SDk and receive an error like: Fatal error: Uncaught CurlException: 60: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed thrown in C:\AppServ\www\xxx\fb\src\base_facebook.php on line 889 Open file base_facebook.php Goto line 873 and add […]

Read full story Comments { 0 }
PHP CURL class support basic authorization, HTTP SOCKS5 proxy and much more

PHP CURL class support basic authorization, HTTP SOCKS5 proxy and much more

This is a useful class written by me and use it regularly. Features HTTPS connection Basic authorization, HTTP proxy SOCKS5 proxy Cookie jar and much more… For some usage, you can read more: PHP & CURL: step by step

Read full story Comments { 1 }
PHP & CURL: step by step

PHP & CURL: step by step

After you read this article: Getting data without risking death with PHP, CURL, you’ve seen the power of CURL. I’ll write more about CURL to introduce a useful PHP class written by me and use it regularly. But first let’s take a CURL research through the examples, step by step: Example 1: GET, include response […]

Read full story Comments { 0 }
CURL cookie.txt file format

CURL cookie.txt file format

CURL autogenerate file cookie.txt: # Netscape HTTP Cookie File # http://curl.haxx.se/rfc/cookie_spec.html # This file was generated by libcurl! Edit at your own risk. www.filefactory.com FALSE / FALSE 0 PHPSESSID 8dcolkh52m2eo4rv61aolurjd7 .filefactory.com TRUE / FALSE 1342341229 ff_referrer_hash HDAgPzI bitshare.com FALSE / FALSE 0 PHPSESSID qjv4u6g6k20s8brar2o17msk26 bitshare.com FALSE / FALSE 1342401324 last_file_downloaded b5b7gbwq freakshare.com FALSE /files/9q5hajyh/ FALSE […]

Read full story Comments { 0 }

Getting data without risking death with PHP, CURL

Introduction PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this […]

Read full story Comments { 0 }