All pastes #276837 Raw Edit

Yancho

public text v1 · immutable
·published 2006-12-12 19:03 UTC
rendered paste body
<html>
<body bgcolor=white>
<?php
# Variable Process and Session Check
	IF (!isset($_GET)) {$_TGV = $HTTP_GET_VARS;} ELSE {$_TGV = $_GET;}
	while(list($key, $var) = each($_TGV)) {
		while($var != utf8_decode($var))	{$var = utf8_decode($var);}
		while($var != urldecode($var))	{$var = urldecode($var);}
		$var = htmlentities($var);
		IF (function_exists('html_entity_decode')) {
			$var = html_entity_decode($var);
		} ELSE {
			$var = unhtmlentities($var);
		}
		while($var != strip_tags($var))	{$var = strip_tags($var);}
		$pieces = explode("\"",$var);		$var = $pieces[0];
		$pieces = explode("'",$var);		$var = $pieces[0];
		$pieces = explode(" ",$var);		$var = $pieces[0];
		IF (eregi('_id', $key) || $key == 'id') {IF (!is_numeric($var)) {$var=0;}}
		$_GPV[$key] = $var;
	}

	IF (!isset($_POST)) {$_TPV = $HTTP_POST_VARS;} ELSE {$_TPV = $_POST;}
	while(list($key, $var) = each($_TPV)) {
		while($var != utf8_decode($var))	{$var = utf8_decode($var);}
		while($var != urldecode($var))	{$var = urldecode($var);}
		$var = htmlentities($var);

		IF (function_exists('html_entity_decode')) {
			$var = html_entity_decode($var);
		} ELSE {
			$var = unhtmlentities($var);
		}
		while($var != strip_tags($var))	{$var = strip_tags($var);}
		IF (eregi('_id', $key) || $key == 'id') {IF (!is_numeric($var)) {$var=0;}}
		$_GPV[$key] = $var;
	}

# Continue with get details
	$fontface	= "verdana";
	$fontsize	= "2";
	$stdcolor	= "black";
	$_out	= '';

# Continue with get details
	$whois = str_replace('%ORD_DOMAIN%', $_GPV['ord_domain'], $_GPV['server']);

# Support .co.za
	IF (strpos($_GPV['server'], 'whois.co.za') !== FALSE) {
		$lines = file('http://'.$whois);
		foreach ($lines as $line_num => $line) {$_out .= $line;}

# Support .mt
	} ELSEIF (strpos($_GPV['server'], '.com.mt') !== FALSE || strpos($_GPV['server'], '.net.mt') || strpos($_GPV['server'], '.org.mt')) {
		$lines = file('https://'.$whois);
		foreach ($lines as $line_num => $line) {$_out .= $line;}

# Normal whois lookup
	} ELSE {
		$_out .= '<pre>';
		$fp = fsockopen($whois, 43, $errno, $errstr, 10);
		fputs($fp, "$_GPV[ord_domain]\r\n");
		while(!feof($fp)) {$_out .= fgets($fp,128);}
		fclose($fp);
		$_out .= '</pre>';
		$_out .= '<p align=center><a href=javascript:window.close()><font face='.$fontface.' size='.$fontsize.' color='.$stdcolor.'><b>Close</b></font></a>';
	}
	echo $_out;
?>
</body>
</html>
<?
# For php < 4.3 compatability
# replaces html_entity_decode
function unhtmlentities($string) {
	$trans_tbl = get_html_translation_table(HTML_ENTITIES);
	$trans_tbl = array_flip($trans_tbl);
	return strtr($string, $trans_tbl);
}
?>