<?php
function mssql_escape_string($string_to_escape) { $replaced_string = str_replace("'","''",$string_to_escape); return $replaced_string; } 
function isValidEmail($email){ return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email); }
function showMessage($type,$message,$time = NULL,$url = NULL)
{ 
	if ( $time == NULL || $url == NULL )
	{
		echo '<div class="'.$type.'">'.$message.'</div>'; 
	}
	else
	{
		echo '<div class="'.$type.'">'.$message.'<br /><a href="'.$url.'">Redirect me now!</a></div>'; 
		echo '<META http-equiv="refresh" content="'.$time.';URL='.$url.'">';
	}
}
function serverStatusCheck( $ip, $port ) { $fp = @fsockopen($ip, $port, $errno, $errstr,1); if (!$fp) { return '<font color="red">Offline</font>'; } else { return '<font color="green">Online</font>'; fclose($fp); } }
?>