Page 1 of 2

get the result

Posted: Tue Aug 03, 2010 4:06 am
by everydayrun
Take a look at this tool,
how it returns the result,when the user click "submit query" button?

Re: get the result

Posted: Tue Aug 03, 2010 6:43 am
by klevis miho
What is your problem?

Re: get the result

Posted: Tue Aug 03, 2010 7:17 am
by everydayrun
klevis miho wrote:What is your problem?
how to make the database that returns the result.

Re: get the result

Posted: Tue Aug 03, 2010 7:24 am
by klevis miho
There is no need to make a database at all

Re: get the result

Posted: Tue Aug 03, 2010 9:24 am
by everydayrun
klevis miho wrote:There is no need to make a database at all
confused! if there is no a database, where and how i can get the result?could you give me more details?thank you

Re: get the result

Posted: Tue Aug 03, 2010 9:36 am
by klevis miho
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.

Re: get the result

Posted: Wed Aug 04, 2010 7:36 am
by everydayrun
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.
but the input by the vistor is the domain name not an ip,how to change the ip into domain name?

Re: get the result

Posted: Wed Aug 04, 2010 7:41 am
by klevis miho
Use this:
$ip = gethostbyname('www.example.com');

Re: get the result

Posted: Wed Aug 04, 2010 8:57 am
by everydayrun
klevis miho wrote:Use this:
$ip = gethostbyname('www.example.com');

Code: Select all

<?php
$ip = gethostbyname('$_POST['input']');
echo $ip;
?> 
now,if i get the $ip that inputed by the vistor,how to make it have some relations with bing serch.
do you know how does this site(http://www.sitesonmyip.com/) do?

Re: get the result

Posted: Wed Aug 04, 2010 9:04 am
by klevis miho
$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.

Re: get the result

Posted: Wed Aug 04, 2010 9:31 am
by everydayrun
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.
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.

Re: get the result

Posted: Wed Aug 04, 2010 9:35 am
by klevis miho
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.

Re: get the result

Posted: Wed Aug 04, 2010 7:59 pm
by everydayrun
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.
sorry,this is inputted by the vistor,how to make it dynamicly nor fixed.

Re: get the result

Posted: Thu Aug 05, 2010 4:24 am
by klevis miho
Put the variable $ip instead of a fixed ip.

Re: get the result

Posted: Thu Aug 05, 2010 8:45 am
by everydayrun

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;
i am sorry,when i used this code,it can't catch someshing.why?