サイトのリバース IP を表示するスクリプトを作成したいと考えています。このために、サードパーティの Web サイトを使用します。私のスクリプトは次のとおりです。
<?php
$ip='http://viewdns.info/reverseip/?host=barnesandnoble.com';
$useragent='Mozilla/5.0 (BlackBerry; U; BlackBerry 9700; pt) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.546 Mobile Safari/534.8+';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $ip);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
$file = curl_exec($ch);
echo ($file); //this is for testing that files are getting or not
?>
しかし、これは何も返していません。私のコードエラーですか?または CURL はこの種の Web ページを取得できませんか?