Get into website
I used below code to get into a website.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'www.g.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "aa:qq");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH开发者_开发技巧_BASIC);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
But i m getting blank page.Whre am i going wrong?
You don't echo
or print
anything.
Try echo $info;
or echo $output;
精彩评论