PHP and CURL





11
Date Submitted Tue. May. 23rd, 2006 8:48 AM
Revision 1 of 1
Coder mattrmiller
Tags CURL | PHP
Comments 2 comments
Example of how to use CURL with PHP.


        // Call page
        $cURL = curl_init();   
        curl_setopt($cURL, CURLOPT_URL,"http://www.myurl.com");
        curl_setopt($cURL, CURLOPT_POST, 1);
        curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($cURL, CURLOPT_POSTFIELDS, "foo=1&bar=2");
        $strPage = curl_exec($cURL);
        curl_close($cURL);
       
        // Output page
        die($strPage);

 

Matthew R. Miller

www.bluecreststudios.com
=================
Matthew R. Miller

http://bluecreststudios.com
http://www.codeandcoffee.com

Comments

Comments ?!?
Wed. May. 24th, 2006 2:33 AM    Beginner baldo
  Comments CURL = Client URL
Mon. Sep. 11th, 2006 7:02 AM    Scripter ctiggerf

Voting