Introducing PHP Curl

What is Curl: cURL stands for "Client URLs”. cURL and libcurl are libraries which allow you to communicate and connect to many kind of servers with a variety of Internet protocols. Libcurl library is developed by “Daniel Stenberg”.

Following aspects a libcurl supports:

  • http, ftp, gopher, telnet, dict, file, and ldap protocols.
  • It supports https certificates
  • http post, http put, ftp uploading

Curl is used to ‘implement payment gateways’ in various kind of payment notification scripts,login the other websites and access members only section and download and upload files from remote servers.

Curl follows the following steps:

curl_init – It is used to initializes the session and returns a cURL handle which can be passed to other cURL functions.

curl_setopt – This is the most important function of Curl library. All curl operations are performed by this function. This function is called many times and defines exactly what we want the Curl library to do.

curl_exec – It is ued to execute a cURL session.

curl_close – Closes the current cURL session.

Example: In this example a new curl session is initializing and used to fetching a web page

// Following lines are used to curl initialization $ch = curl_init();

// Set url to perform operation in it

curl_setopt($ch, CURLOPT_URL, "http://www.saitechnosys.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);

// This function is used to catch the URL and pass it to the browser

curl_exec($ch);

// Following function is used to close the url resources and
free up the system resources

curl_close($ch);

?>

Comments

    Post new comment

    • Web page addresses and e-mail addresses turn into links automatically.
    • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
    • Lines and paragraphs break automatically.

    More information about formatting options

    CAPTCHA
    This question is for testing whether you are a human visitor and to prevent automated spam submissions.
    5 + 0 =
    Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
Categories
Latest Blogs
Monthly Archives
 
   
   
   
         
Web Design Application & Web Development Multimedia solution Other IT Services Offshore Staffing
Creative website design
Web Template Design & Integration
PSD to XHTML/CSS Conversation
Website Redesign
Flash Website Design
Logo Design
E-commerce Development
Product catalogue development
Custom Software Development
Customized CMS
Dynamic web site
Open Source Customizations
 
Corporate Logo Design
Flash Presentations
PowerPoint Presentations
Broachers Design
E-Mailer Design
Graphic Design
Data entry
Internet Marketing
Domain Registration
Web Hosting Service
Graphics / Image Editing
Web Promotion
Web designer
PHP Developer
.Net Developer
ASP.Net Development
Data Entry Operator
 
     
  Privacy Policy | Disclaimer | Terms & Conditions Copyright 2007-09 SAI Technosys