redarrow Posted March 5, 2007 Share Posted March 5, 2007 the url off php.net is only an example the reel address has ip's on it. <?php $fp = fsockopen ("www.php.net", 80, $errno, $errstr, 30); if(!$fp) { echo $errstr; $x= eregi("^[0-9]{1,3}\.+[0-9]{1,3}\.+[0-9]{1,3}\.+[0-9]{1,3}$",$fp); } else { fwrite($fp, "GET / HTTP/1.1\r\nHost: $x\r\nConnection: Keep-Alive\r\n\r\n"); $data = ''; while(!feof($fp)) { $data .= fread($fp, 4096); if(substr($data, -9)=="\r\n\r\n0\r\n\r\n") { exit; } } } echo $data; ?> Link to comment https://forums.phpfreaks.com/topic/41289-how-to-get-all-ip-from-a-page/ Share on other sites More sharing options...
pocobueno1388 Posted March 5, 2007 Share Posted March 5, 2007 All you did was post code without any explanation. "how to get all ip from a page" isn't enough information to attempt to answer your question. Link to comment https://forums.phpfreaks.com/topic/41289-how-to-get-all-ip-from-a-page/#findComment-200060 Share on other sites More sharing options...
redarrow Posted March 5, 2007 Author Share Posted March 5, 2007 i would like to no how to get all information in this example ip's from a website page thank you. learning this one ok. Link to comment https://forums.phpfreaks.com/topic/41289-how-to-get-all-ip-from-a-page/#findComment-200062 Share on other sites More sharing options...
redarrow Posted March 5, 2007 Author Share Posted March 5, 2007 why dont this work please just blank screen not sure but i think the preg_match wrong. should display all the ip's on the website. <?php echo get_url_title("http://www.kloth.net/internet/badbots-2003.php"); function get_url_title($url, $timeout = 2) { $url = parse_url($url); if(!in_array($url['scheme'],array('','http'))) return; $fp = fsockopen ($url['host'], ($url['port'] > 0 ? $url['port'] : 80), $errno, $errstr, $timeout); if (!$fp) { return; // echo "$errstr ($errno)<br>\n"; } else { fputs ($fp, "GET /".$url['path'].($url['query'] ? '?'.$url['query'] : '')." HTTP/1.0\r\nHost: ".$url['host']."\r\n\r\n"); $d = ''; while (!feof($fp)) { $d .= fgets ($fp,2048); if(preg_match('/^[0-9]{1,3}\.+[0-9]{1,3}\.+[0-9]{1,3}\.+[0-9]{1,3}/', $d, $m)) break; } fclose ($fp); return $m[3]; } } ?> Link to comment https://forums.phpfreaks.com/topic/41289-how-to-get-all-ip-from-a-page/#findComment-200080 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.