How to use crawler in password protected directory?

by barkkathulla 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);
}

829
like
0
dislike
0
mail
flag

You must LOGIN to add comments