Login To InderWeb ! Just Play !

Username:
Password:

UserSubmittedComments

php curl

What is curl and how to use it in a PHP code file.

curl is the client URL function library that enable you able to make live requests and getting data or result from live resources and much more.. PHP supports it through libcurl. To enable support for libcurl when installing PHP add --with-curl=[location of curl libraries] to the configure statement before compiling. The curl package must be installed prior to installing PHP. Most major functions desired when connecting to remote web servers are included in curl, including POST and GET form posting, SSL support, HTTP authentication, session and cookie handling.

CURL requests For Search keywords

Curl is good for getting remote data and making dynamic requests.

<form method="post"><input type="text" name="search" value="india"><input type="submit" value="Search"></form>

<?php
// create a new cURL resource
$ch = curl_init();

// set URL and other appropriate options
$result_cnt=2;
$search=$_REQUEST['search']?$_REQUEST['search']:"";
$url="http://www.google.co.in/search?num=$result_cnt&hl=en&safe=off&q={$search}";
Syndicate content

Popular Tags

tags in Web Links