<?php

$ip = getenv('REMOTE_ADDR');
$url = "http://api.hostip.info/get_html.php?".$ip;

$contents = file_get_contents($url);
$values = split("[\n|\r]",$contents);

foreach($values as $vals) {
	$myvalues = split(": ",$vals);
	$line = "<strong>".$myvalues[0].":</strong> ".$myvalues[1]."<br />";
	echo $line;
}

?>
3
Contributors
3
Replies
6
Views
7 Years
Discussion Span
Last Post by sammry
0

geotargeting hadn't crossed my mind, cheers
makes for a nice IP logging system ;)
however split() has been deprecated as of 5.3.0, best to use preg_split()

thanks again

0

Thanks for the heads up on split(). 5.3.0 had only been out for 8 months or so and old habits are hard to break. :)

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.