PHP cURL Cookies Example

Want to learn how to use PHP cURL with Cookies? Well, it’s pretty simple so let’s go see the code but first let’s make a scenario…

Say we have a page called ‘cookiepage.php’ in a particular website that checks for the cookie set by the homepage and will only return the proper output if the cookie exists. How do you do it? Here’s how…

(more…)

 

How to Post Data with cURL in PHP

Do you need to post data to a website using PHP? It’s actually pretty easy to do. Here’s the code.

< ?php
$urltopost = "http://somewebsite.com/script.php";
$datatopost = array (
"firstname" => "Mike",
"lastname" => "Lopez",
"email" => "my@email.com",
);

 <a href="http://coderscult.com/php/php-curl/2008/05/20/how-to-post-data-with-curl-in-php/#more-40" class="more-link">(more…)</a>

 

PHP cURL Tutorial and Example

Do you want to learn how to use cURL in PHP? Well, if so then this tutorial is for you. But before anything else, what is cURL?

cURL is a command line tool for transferring files with URL syntax. The strong point of cURL is the number of data transfer protocols it supports. It is distributed under the MIT License which makes cURL free software. It supports FTP, FTPS, HTTP, HTTPS, TFTP, SCP, SFTP, Telnet, DICT, FILE and LDAP. – based on Wikipedia’s definition

(more…)