How to use crawler in password protected directory?
by barkkathulla[ Edit ] 2014-04-18 17:51:44
How to use crawler in password protected directory?
<?php
$url = 'test.php'; // Required url to crawl..
call_datas($url, 'post');
function getUrl(call_datas) {
$data = array('content' => 'required content tp post...');
$data_element = '';
foreach($data as $key=>$value) { $data_element .= $key.'='.$value.'&'; }
rtrim($data_element,'&');
$ch = curl_init();
/***Give ur user name and password here ***/
curl_setopt($ch, CURLOPT_USERPWD,'required user name' . ":" . 'required password');
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($data));
curl_setopt($ch,CURLOPT_POSTFIELDS,$data_element);
$result = curl_exec($ch);
curl_close($ch);
}