get the result
Posted: Tue Aug 03, 2010 4:06 am
Take a look at this tool,
how it returns the result,when the user click "submit query" button?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
how it returns the result,when the user click "submit query" button?
how to make the database that returns the result.klevis miho wrote:What is your problem?
confused! if there is no a database, where and how i can get the result?could you give me more details?thank youklevis miho wrote:There is no need to make a database at all
but the input by the vistor is the domain name not an ip,how to change the ip into domain name?klevis miho wrote:Try to search on bing.com like this ip:your-website-ip.
It displays a list of websites that are on your websites IP.
Then you would use php's cURL library to get the pages that bing.com displays.
Then using some regular expressions you would get the domains that bing.com displays.
Then you would print the catched domains.
klevis miho wrote:Use this:
$ip = gethostbyname('www.example.com');
Code: Select all
<?php
$ip = gethostbyname('$_POST['input']');
echo $ip;
?>
i am sorry,when i copied and run this code .there was nothing that i catched. what this 'http://www.bing.com/search?q=ip%3A'.$ip ... p=1&sc=8-0' mean? thank you.klevis miho wrote:$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.bing.com/search?q=ip%3A'.$ip ... p=1&sc=8-0');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
curl_close ($ch);
You could do a echo $contents; to see what you have catched.
After that you should use a regular expression to get only the domain.
sorry,this is inputted by the vistor,how to make it dynamicly nor fixed.klevis miho wrote:Look:
http://www.bing.com/search?q=ip%3A66.14 ... p=1&sc=8-3
This address gives you the domains that are on the 66.147.240.97 ip.
Code: Select all
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.bing.com/search?q=ip%3A'.$ip.'&form=QBLH&qs=HS&sk=&pq=&sp=1&sc=8-0');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
curl_close ($ch);
echo $contents;