[Opgelost] WHOIS html omzetten UDT

Nederlandse ondersteuning voor CMS Made Simple

Moderator: velden

User avatar
erpee
Power Poster
Power Poster
Posts: 771
Joined: Sat Jul 07, 2007 9:22 am
Location: Almelo, The Netherlands

[Opgelost] WHOIS html omzetten UDT

Post by erpee »

Ik heb een stuk code dat in een UDT moet komen. Ik heb al een aantal dingen met "echo" geprobeerd ... maarja ... de ene foutmelding na de ander.

dit is de code:

Code: Select all

<form action="<?=$_SERVER['PHP_SELF'];?>">
<p><b><label for="domain">Domain/IP Address:</label></b> 
<input type="text" name="domain" id="domain" value="<?=$domain;?>"> 
<input type="submit" value="Lookup"></p>
</form>
wie ziet het licht?
Last edited by erpee on Tue Mar 16, 2010 3:02 pm, edited 1 time in total.
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: html omzetten UDT

Post by Jos »

Code: Select all

echo '<form action="' . $_SERVER['PHP_SELF'] . '">
<p><b><label for="domain">Domain/IP Address:</label></b> 
<input type="text" name="domain" id="domain" value="' . $domain . '"> 
<input type="submit" value="Lookup"></p>
</form>';
User avatar
erpee
Power Poster
Power Poster
Posts: 771
Joined: Sat Jul 07, 2007 9:22 am
Location: Almelo, The Netherlands

Re: html omzetten UDT

Post by erpee »

Dat ging goed ... Nu gebeurt echter het volgende . als ik een domein opzoek, komt 'ie vanzelf op mijn homepagina ... da's weer niet de bedoeling.

Dit is de hele UDT-code

Code: Select all

$domain = $_GET['domain'];

// For the full list of TLDs/Whois servers see http://www.iana.org/domains/root/db/ and http://www.whois365.com/en/listtld/
$whoisservers = array(
	"ac" =>"whois.nic.ac",
	"ae" =>"whois.nic.ae",
	"aero"=>"whois.aero",
	"af" =>"whois.nic.af",
	"ag" =>"whois.nic.ag",
	"al" =>"whois.ripe.net",
	"am" =>"whois.amnic.net",
	"arpa" =>"whois.iana.org",
	"as" =>"whois.nic.as",
	"asia" =>"whois.nic.asia",
	"at" =>"whois.nic.at",
	"au" =>"whois.aunic.net",
	"az" =>"whois.ripe.net",
	"ba" =>"whois.ripe.net",
	"be" =>"whois.dns.be",
	"bg" =>"whois.register.bg",
	"bi" =>"whois.nic.bi",
	"biz" =>"whois.biz",
	"bj" =>"whois.nic.bj",
	"br" =>"whois.registro.br",
	"bt" =>"whois.netnames.net",
	"by" =>"whois.ripe.net",
	"bz" =>"whois.belizenic.bz",
	"ca" =>"whois.cira.ca",
	"cat" =>"whois.cat",
	"cc" =>"whois.nic.cc",
	"cd" =>"whois.nic.cd",
	"ch" =>"whois.nic.ch",
	"ci" =>"whois.nic.ci",
	"ck" =>"whois.nic.ck",
	"cl" =>"whois.nic.cl",
	"cn" =>"whois.cnnic.net.cn",
	"com" =>"whois.verisign-grs.com",
	"coop" =>"whois.nic.coop",
	"cx" =>"whois.nic.cx",
	"cy" =>"whois.ripe.net",
	"cz" =>"whois.nic.cz",
	"de" =>"whois.denic.de",
	"dk" =>"whois.dk-hostmaster.dk",
	"dm" =>"whois.nic.cx",
	"dz" =>"whois.ripe.net",
	"edu" =>"whois.educause.edu",
	"ee" =>"whois.eenet.ee",
	"eg" =>"whois.ripe.net",
	"es" =>"whois.ripe.net",
	"eu" =>"whois.eu",
	"fi" =>"whois.ficora.fi",
	"fo" =>"whois.ripe.net",
	"fr" =>"whois.nic.fr",
	"gb" =>"whois.ripe.net",
	"gd" =>"whois.adamsnames.com",
	"ge" =>"whois.ripe.net",
	"gg" =>"whois.channelisles.net",
	"gi" =>"whois2.afilias-grs.net",
	"gl" =>"whois.ripe.net",
	"gm" =>"whois.ripe.net",
	"gov" =>"whois.nic.gov",
	"gr" =>"whois.ripe.net",
	"gs" =>"whois.nic.gs",
	"gw" =>"whois.nic.gw",
	"gy" =>"whois.registry.gy",
	"hk" =>"whois.hkirc.hk",
	"hm" =>"whois.registry.hm",
	"hn" =>"whois2.afilias-grs.net",
	"hr" =>"whois.ripe.net",
	"hu" =>"whois.nic.hu",
	"ie" =>"whois.domainregistry.ie",
	"il" =>"whois.isoc.org.il",
	"in" =>"whois.inregistry.net",
	"info" =>"whois.afilias.info",
	"int" =>"whois.iana.org",
	"io" =>"whois.nic.io",
	"iq" =>"vrx.net",
	"ir" =>"whois.nic.ir",
	"is" =>"whois.isnic.is",
	"it" =>"whois.nic.it",
	"je" =>"whois.channelisles.net",
	"jobs" =>"jobswhois.verisign-grs.com",
	"jp" =>"whois.jprs.jp",
	"ke" =>"whois.kenic.or.ke",
	"kg" =>"www.domain.kg",
	"ki" =>"whois.nic.ki",
	"kr" =>"whois.nic.or.kr",
	"kz" =>"whois.nic.kz",
	"la" =>"whois.nic.la",
	"li" =>"whois.nic.li",
	"lt" =>"whois.domreg.lt",
	"lu" =>"whois.dns.lu",
	"lv" =>"whois.nic.lv",
	"ly" =>"whois.nic.ly",
	"ma" =>"whois.iam.net.ma",
	"mc" =>"whois.ripe.net",
	"md" =>"whois.ripe.net",
	"me" =>"whois.meregistry.net",
	"mg" =>"whois.nic.mg",
	"mil" =>"whois.nic.mil",
	"mn" =>"whois.nic.mn",
	"mobi" =>"whois.dotmobiregistry.net",
	"ms" =>"whois.adamsnames.tc",
	"mt" =>"whois.ripe.net",
	"mu" =>"whois.nic.mu",
	"museum" =>"whois.museum",
	"mx" =>"whois.nic.mx",
	"my" =>"whois.mynic.net.my",
	"na" =>"whois.na-nic.com.na",
	"name" =>"whois.nic.name",
	"net" =>"whois.verisign-grs.net",
	"nf" =>"whois.nic.nf",
	"nl" =>"whois.domain-registry.nl",
	"no" =>"whois.norid.no",
	"nu" =>"whois.nic.nu",
	"nz" =>"whois.srs.net.nz",
	"org" =>"whois.pir.org",
	"pl" =>"whois.dns.pl",
	"pm" =>"whois.nic.pm",
	"pr" =>"whois.uprr.pr",
	"pro" =>"whois.registrypro.pro",
	"pt" =>"whois.dns.pt",
	"re" =>"whois.nic.re",
	"ro" =>"whois.rotld.ro",
	"ru" =>"whois.ripn.net",
	"sa" =>"whois.nic.net.sa",
	"sb" =>"whois.nic.net.sb",
	"sc" =>"whois2.afilias-grs.net",
	"se" =>"whois.iis.se",
	"sg" =>"whois.nic.net.sg",
	"sh" =>"whois.nic.sh",
	"si" =>"whois.arnes.si",
	"sk" =>"whois.ripe.net",
	"sm" =>"whois.ripe.net",
	"st" =>"whois.nic.st",
	"su" =>"whois.ripn.net",
	"tc" =>"whois.adamsnames.tc",
	"tel" =>"whois.nic.tel",
	"tf" =>"whois.nic.tf",
	"th" =>"whois.thnic.net",
	"tj" =>"whois.nic.tj",
	"tk" =>"whois.dot.tk",
	"tl" =>"whois.nic.tl",
	"tm" =>"whois.nic.tm",
	"tn" =>"whois.ripe.net",
	"to" =>"whois.tonic.to",
	"tp" =>"whois.nic.tl",
	"tr" =>"whois.nic.tr",
	"travel" =>"whois.nic.travel",
	"tv" => "tvwhois.verisign-grs.com",
	"tw" =>"whois.twnic.net.tw",
	"ua" =>"whois.net.ua",
	"ug" =>"whois.co.ug",
	"uk" =>"whois.nic.uk",
	"us" =>"whois.nic.us",
	"uy" =>"nic.uy",
	"uz" =>"whois.cctld.uz",
	"va" =>"whois.ripe.net",
	"vc" =>"whois2.afilias-grs.net",
	"ve" =>"whois.nic.ve",
	"vg" =>"whois.adamsnames.tc",
	"wf" =>"whois.nic.wf",
	"ws" =>"whois.website.ws",
	"yt" =>"whois.nic.yt",
	"yu" =>"whois.ripe.net");

function LookupDomain($domain){
	global $whoisservers;
	$whoisserver = "";
	foreach($whoisservers as $tld=>$server) {
		if(substr($domain, -strlen($tld)) == $tld) {
			$whoisserver = $server;
			break;
		}
	}
	if(!$whoisserver) {
		return "Error: No appropriate Whois server found for $domain domain!";
	}
	$result = QueryWhoisServer($whoisserver, $domain);
	if(!$result) {
		return "Error: No results retrieved from $whoisserver server for $domain domain!";
	}
	else {
		preg_match("/Whois Server: (.*)/", $result, $matches);
		$secondary = $matches[1];
		if($secondary) {
			$result = QueryWhoisServer($secondary, $domain);
			return "$domain domain lookup results from $secondary server:\n\n" . $result;
		}
		else {
			return "$domain domain lookup results from $whoisserver server:\n\n" . $result;
		}
	}
}

function LookupIP($ip) {
	$whoisservers = array(
		//"whois.afrinic.net", // Africa - returns timeout error :-(
		"whois.apnic.net", // Asia/Pacific - OK :-)
		"whois.arin.net", // North America - OK :-)
		"whois.lacnic.net", // Latin America and some Caribbean - OK :-)
		"whois.ripe.net" // Europe, the Middle East, and Central Asia - OK :-)
	);
	$out = array();
	foreach($whoisservers as $whoisserver) {
		$result = QueryWhoisServer($whoisserver, $ip);
		if(preg_match("/Country: (.*)/i", $result, $matches)) {
			$out[]= "lookup results for $ip from $whoisserver server:\n\n" . $result;
		}
	}
	return count($out) . " RESULTS FOUND:\n-------------\n" . implode("\n\n-------------\n\n", $out);
}

function ValidateIP($ip) {
	$ipnums = explode(".", $ip);
	if(count($ipnums) != 4) {
		return false;
	}
	foreach($ipnums as $ipnum) {
		if(!is_numeric($ipnum) || ($ipnum > 255)) {
			return false;
		}
	}
	return $ip;
}

function ValidateDomain($domain) {
	if(!preg_match("/^([-a-z0-9]{2,100})\.([a-z\.]{2,8})$/i", $domain)) {
		return false;
	}
	return $domain;
}

function QueryWhoisServer($whoisserver, $domain) {
	$port = 43;
	$timeout = 10;
	$fp = @fsockopen($whoisserver, $port, $errno, $errstr, $timeout) or die("Socket Error " . $errno . " - " . $errstr);
	fputs($fp, $domain . "\r\n");
	$out = "";
	while(!feof($fp)){
		$out .= fgets($fp);
	}
	fclose($fp);
	
	return $out;
}
echo '<form action="' . $_SERVER['PHP_SELF'] . '">
<p><b><label for="domain">Domain/IP Address:</label></b> 
<input type="text" name="domain" id="domain" value="' . $domain . '"> 
<input type="submit" value="Lookup"></p>
</form>';

if($domain) {
	$domain = trim($domain);
	if(ValidateIP($domain)) {
		$result = LookupIP($domain);
	}
	elseif(ValidateDomain($domain)) {
		$result = LookupDomain($domain);
	}
	else die("Invalid Input!");
	echo "<pre>\n" . $result . "\n</pre>\n";
}
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
User avatar
erpee
Power Poster
Power Poster
Posts: 771
Joined: Sat Jul 07, 2007 9:22 am
Location: Almelo, The Netherlands

Re: html omzetten UDT

Post by erpee »

iemand een idee?
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
Calimer0

Re: html omzetten UDT

Post by Calimer0 »

erpee wrote: Dat ging goed ... Nu gebeurt echter het volgende . als ik een domein opzoek, komt 'ie vanzelf op mijn homepagina ... da's weer niet de bedoeling.
Hoi erpee, wat bedoel je met: "komt 'ie vanzelf"?
Als jij in je form een domein opzoekt, dan krijg je daarna het resultaat te zien op dezelfde pagina als waar je hem vandaan opgeroepen hebt.
User avatar
erpee
Power Poster
Power Poster
Posts: 771
Joined: Sat Jul 07, 2007 9:22 am
Location: Almelo, The Netherlands

Re: html omzetten UDT

Post by erpee »

Tsja, dat was wel de bedoeling ...

Toch, als ik op verzenden druk, wordt de "home"-page geladen.
Als jij dit als UDT uitvoert, gaat het dan wel goed?
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
Calimer0

Re: html omzetten UDT

Post by Calimer0 »

Hoi erpee,
Voeg dit toe aan het begin van je UDT en verander daar alias-2...

Code: Select all

//Execute some smarty code to make the archive link
global $gCms;
$smarty = &$gCms->GetSmarty();
$smarty_data = "{cms_selflink href='alias-2'}"; //link van je pagina
$smarty->_compile_source('temporary template', $smarty_data, $_compiled );
@ob_start();
$smarty->_eval('?>' . $_compiled);
$_contents = @ob_get_contents();
@ob_end_clean();
$link= $_contents;
En in je stukje van het aanroepen van je form:

Code: Select all

echo '<form action="'. $link. '">
<p><b><label for="domain">Domain/IP Address:</label></b> 
<input type="text" name="domain" id="domain" value="' . $domain . '"> 
<input type="submit" value="Lookup"></p>
</form>';
Hij geeft daarna bij mij nog een fout van je domein look-up, maar dat is een ander probleem! succes verder.
User avatar
erpee
Power Poster
Power Poster
Posts: 771
Joined: Sat Jul 07, 2007 9:22 am
Location: Almelo, The Netherlands

Re: html omzetten UDT

Post by erpee »

hmmmm .... da's dan weer raar.

Zou toch mooi zijn als er eens een goede whois UDT vrij kwam die limiet vrij kan checken op NL naam.

Iemand nog zoiets op de plank????  ;D
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
Calimer0

Re: WHOIS html omzetten UDT

Post by Calimer0 »

erpee, als je je $whoisservers in je function LookupDomain($domain){ zet, dan werkt het wel allemaal.
je moet dan alleen die global $whoisservers weghalen.
User avatar
erpee
Power Poster
Power Poster
Posts: 771
Joined: Sat Jul 07, 2007 9:22 am
Location: Almelo, The Netherlands

Re: WHOIS html omzetten UDT

Post by erpee »

Tsja ... je bent me echt kwijtgeraakt ....

Zou je de hele UDT eens neer kunnen zetten .... Ik snap het niet meer. (ligt niet aan jouw uitleg, meer aan mijn begrip ;))
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
Calimer0

Re: WHOIS html omzetten UDT

Post by Calimer0 »

Dit is mijn volledige UDT:

Code: Select all

//Execute some smarty code to make the archive link
global $gCms;
$smarty = &$gCms->GetSmarty();
$smarty_data = "{cms_selflink href='alias-2'}"; //this is the link
$smarty->_compile_source('temporary template', $smarty_data, $_compiled );
@ob_start();
$smarty->_eval('?>' . $_compiled);
$_contents = @ob_get_contents();
@ob_end_clean();
$archivelink = $_contents;
$domain = $_GET['domain'];


function LookupDomain($domain){
// For the full list of TLDs/Whois servers see http://www.iana.org/domains/root/db/ and http://www.whois365.com/en/listtld/
$whoisservers = array(
	"ac" =>"whois.nic.ac",
	"ae" =>"whois.nic.ae",
	"aero"=>"whois.aero",
	"af" =>"whois.nic.af",
	"ag" =>"whois.nic.ag",
	"al" =>"whois.ripe.net",
	"am" =>"whois.amnic.net",
	"arpa" =>"whois.iana.org",
	"as" =>"whois.nic.as",
	"asia" =>"whois.nic.asia",
	"at" =>"whois.nic.at",
	"au" =>"whois.aunic.net",
	"az" =>"whois.ripe.net",
	"ba" =>"whois.ripe.net",
	"be" =>"whois.dns.be",
	"bg" =>"whois.register.bg",
	"bi" =>"whois.nic.bi",
	"biz" =>"whois.biz",
	"bj" =>"whois.nic.bj",
	"br" =>"whois.registro.br",
	"bt" =>"whois.netnames.net",
	"by" =>"whois.ripe.net",
	"bz" =>"whois.belizenic.bz",
	"ca" =>"whois.cira.ca",
	"cat" =>"whois.cat",
	"cc" =>"whois.nic.cc",
	"cd" =>"whois.nic.cd",
	"ch" =>"whois.nic.ch",
	"ci" =>"whois.nic.ci",
	"ck" =>"whois.nic.ck",
	"cl" =>"whois.nic.cl",
	"cn" =>"whois.cnnic.net.cn",
	"com" =>"whois.verisign-grs.com",
	"coop" =>"whois.nic.coop",
	"cx" =>"whois.nic.cx",
	"cy" =>"whois.ripe.net",
	"cz" =>"whois.nic.cz",
	"de" =>"whois.denic.de",
	"dk" =>"whois.dk-hostmaster.dk",
	"dm" =>"whois.nic.cx",
	"dz" =>"whois.ripe.net",
	"edu" =>"whois.educause.edu",
	"ee" =>"whois.eenet.ee",
	"eg" =>"whois.ripe.net",
	"es" =>"whois.ripe.net",
	"eu" =>"whois.eu",
	"fi" =>"whois.ficora.fi",
	"fo" =>"whois.ripe.net",
	"fr" =>"whois.nic.fr",
	"gb" =>"whois.ripe.net",
	"gd" =>"whois.adamsnames.com",
	"ge" =>"whois.ripe.net",
	"gg" =>"whois.channelisles.net",
	"gi" =>"whois2.afilias-grs.net",
	"gl" =>"whois.ripe.net",
	"gm" =>"whois.ripe.net",
	"gov" =>"whois.nic.gov",
	"gr" =>"whois.ripe.net",
	"gs" =>"whois.nic.gs",
	"gw" =>"whois.nic.gw",
	"gy" =>"whois.registry.gy",
	"hk" =>"whois.hkirc.hk",
	"hm" =>"whois.registry.hm",
	"hn" =>"whois2.afilias-grs.net",
	"hr" =>"whois.ripe.net",
	"hu" =>"whois.nic.hu",
	"ie" =>"whois.domainregistry.ie",
	"il" =>"whois.isoc.org.il",
	"in" =>"whois.inregistry.net",
	"info" =>"whois.afilias.info",
	"int" =>"whois.iana.org",
	"io" =>"whois.nic.io",
	"iq" =>"vrx.net",
	"ir" =>"whois.nic.ir",
	"is" =>"whois.isnic.is",
	"it" =>"whois.nic.it",
	"je" =>"whois.channelisles.net",
	"jobs" =>"jobswhois.verisign-grs.com",
	"jp" =>"whois.jprs.jp",
	"ke" =>"whois.kenic.or.ke",
	"kg" =>"www.domain.kg",
	"ki" =>"whois.nic.ki",
	"kr" =>"whois.nic.or.kr",
	"kz" =>"whois.nic.kz",
	"la" =>"whois.nic.la",
	"li" =>"whois.nic.li",
	"lt" =>"whois.domreg.lt",
	"lu" =>"whois.dns.lu",
	"lv" =>"whois.nic.lv",
	"ly" =>"whois.nic.ly",
	"ma" =>"whois.iam.net.ma",
	"mc" =>"whois.ripe.net",
	"md" =>"whois.ripe.net",
	"me" =>"whois.meregistry.net",
	"mg" =>"whois.nic.mg",
	"mil" =>"whois.nic.mil",
	"mn" =>"whois.nic.mn",
	"mobi" =>"whois.dotmobiregistry.net",
	"ms" =>"whois.adamsnames.tc",
	"mt" =>"whois.ripe.net",
	"mu" =>"whois.nic.mu",
	"museum" =>"whois.museum",
	"mx" =>"whois.nic.mx",
	"my" =>"whois.mynic.net.my",
	"na" =>"whois.na-nic.com.na",
	"name" =>"whois.nic.name",
	"net" =>"whois.verisign-grs.net",
	"nf" =>"whois.nic.nf",
	"nl" =>"whois.domain-registry.nl",
	"no" =>"whois.norid.no",
	"nu" =>"whois.nic.nu",
	"nz" =>"whois.srs.net.nz",
	"org" =>"whois.pir.org",
	"pl" =>"whois.dns.pl",
	"pm" =>"whois.nic.pm",
	"pr" =>"whois.uprr.pr",
	"pro" =>"whois.registrypro.pro",
	"pt" =>"whois.dns.pt",
	"re" =>"whois.nic.re",
	"ro" =>"whois.rotld.ro",
	"ru" =>"whois.ripn.net",
	"sa" =>"whois.nic.net.sa",
	"sb" =>"whois.nic.net.sb",
	"sc" =>"whois2.afilias-grs.net",
	"se" =>"whois.iis.se",
	"sg" =>"whois.nic.net.sg",
	"sh" =>"whois.nic.sh",
	"si" =>"whois.arnes.si",
	"sk" =>"whois.ripe.net",
	"sm" =>"whois.ripe.net",
	"st" =>"whois.nic.st",
	"su" =>"whois.ripn.net",
	"tc" =>"whois.adamsnames.tc",
	"tel" =>"whois.nic.tel",
	"tf" =>"whois.nic.tf",
	"th" =>"whois.thnic.net",
	"tj" =>"whois.nic.tj",
	"tk" =>"whois.dot.tk",
	"tl" =>"whois.nic.tl",
	"tm" =>"whois.nic.tm",
	"tn" =>"whois.ripe.net",
	"to" =>"whois.tonic.to",
	"tp" =>"whois.nic.tl",
	"tr" =>"whois.nic.tr",
	"travel" =>"whois.nic.travel",
	"tv" => "tvwhois.verisign-grs.com",
	"tw" =>"whois.twnic.net.tw",
	"ua" =>"whois.net.ua",
	"ug" =>"whois.co.ug",
	"uk" =>"whois.nic.uk",
	"us" =>"whois.nic.us",
	"uy" =>"nic.uy",
	"uz" =>"whois.cctld.uz",
	"va" =>"whois.ripe.net",
	"vc" =>"whois2.afilias-grs.net",
	"ve" =>"whois.nic.ve",
	"vg" =>"whois.adamsnames.tc",
	"wf" =>"whois.nic.wf",
	"ws" =>"whois.website.ws",
	"yt" =>"whois.nic.yt",
	"yu" =>"whois.ripe.net");

	foreach($whoisservers as $tld=>$server) {
		if(substr($domain, -strlen($tld)) == $tld) {
			$whoisserver = $server;
			break;
		}
	}
	if(!$whoisserver) {
		return "Error: No appropriate Whois server found for $domain domain!";
	}
	$result = QueryWhoisServer($whoisserver, $domain);
	if(!$result) {
		return "Error: No results retrieved from $whoisserver server for $domain domain!";
	}
	else {
		preg_match("/Whois Server: (.*)/", $result, $matches);
		$secondary = $matches[1];
		if($secondary) {
			$result = QueryWhoisServer($secondary, $domain);
			return "$domain domain lookup results from $secondary server:\n\n" . $result;
		}
		else {
			return "$domain domain lookup results from $whoisserver server:\n\n" . $result;
		}
	}
}

function LookupIP($ip) {
	$whoisservers = array(
		//"whois.afrinic.net", // Africa - returns timeout error :-(
		"whois.apnic.net", // Asia/Pacific - OK :-)
		"whois.arin.net", // North America - OK :-)
		"whois.lacnic.net", // Latin America and some Caribbean - OK :-)
		"whois.ripe.net" // Europe, the Middle East, and Central Asia - OK :-)
	);
	$out = array();
	foreach($whoisservers as $whoisserver) {
		$result = QueryWhoisServer($whoisserver, $ip);
		if(preg_match("/Country: (.*)/i", $result, $matches)) {
			$out[]= "lookup results for $ip from $whoisserver server:\n\n" . $result;
		}
	}
	return count($out) . " RESULTS FOUND:\n-------------\n" . implode("\n\n-------------\n\n", $out);
}

function ValidateIP($ip) {
	$ipnums = explode(".", $ip);
	if(count($ipnums) != 4) {
		return false;
	}
	foreach($ipnums as $ipnum) {
		if(!is_numeric($ipnum) || ($ipnum > 255)) {
			return false;
		}
	}
	return $ip;
}

function ValidateDomain($domain) {
	if(!preg_match("/^([-a-z0-9]{2,100})\.([a-z\.]{2,8})$/i", $domain)) {
		return false;
	}
	return $domain;
}

function QueryWhoisServer($whoisserver, $domain) {
	$port = 43;
	$timeout = 10;
	$fp = @fsockopen($whoisserver, $port, $errno, $errstr, $timeout) or die("Socket Error " . $errno . " - " . $errstr);
	fputs($fp, $domain . "\r\n");
	$out = "";
	while(!feof($fp)){
		$out .= fgets($fp);
	}
	fclose($fp);
	
	return $out;
}
echo '<form action="'. $archivelink. '">
<p><b><label for="domain">Domain/IP Address:</label></b> 
<input type="text" name="domain" id="domain" value="' . $domain . '"> 
<input type="submit" value="Lookup"></p>
</form>';

if($domain) {
	$domain = trim($domain);
	if(ValidateIP($domain)) {
		$result = LookupIP($domain);
	}
	elseif(ValidateDomain($domain)) {
		$result = LookupDomain($domain);
	}
	else die("Invalid Input!");
	echo "<pre>\n" . $result . "\n</pre>\n";
}
Groetjes,
Michael
User avatar
erpee
Power Poster
Power Poster
Posts: 771
Joined: Sat Jul 07, 2007 9:22 am
Location: Almelo, The Netherlands

Re: [Opgelost] WHOIS html omzetten UDT

Post by erpee »

Hij doet het. Mooi!

Kan idereen een domein opzoeken via cmsms!
Waarom zou het direct goed moeten gaan? Dan is alle lol weg ...
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

Re: [Opgelost] WHOIS html omzetten UDT

Post by pedes »

zet ik dit gewoon allemaal in een UDT en in de pagna zet ik dan gewoon {naam vd UTD}  ??
of mis ik hier iets ?

mvg,
Peter
Calimer0

Re: [Opgelost] WHOIS html omzetten UDT

Post by Calimer0 »

Ja Peter dat kan gewoon.

Je moet alleen even bovenin dit stukje veranderen:

Code: Select all

$smarty_data = "{cms_selflink href='alias-2'}"; //this is the link
daar moet de pagina waar je de UDT zet komen te staan.
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

Re: [Opgelost] WHOIS html omzetten UDT

Post by pedes »

wellicht mis ik hier iets ... dit werkt niet bij mij ?

alles in de UDT gezet en de 'alias-2' vervangen door 'whois' (das de naam vd pagina)
in de pagina zet ik {udt_whois} (das de naam van de UDT)

na de 'lookup' te klikken duurt het even , krijg een socket error en opent de pagina zonder layout

enig idee ?

Mvg,
Peter
Post Reply

Return to “Dutch - Nederlands”