Location: PHPKode > scripts > Universal comment module > universal-comment-module/func.php
<?php

	function dump($var)
	{
		echo "<pre>";
		print_r($var);
		echo "</pre>";
	}
	
	function getCase()
	{
		if(isset($_REQUEST['case']) && $_REQUEST['case'] !='')
		{
			return $_REQUEST['case'];
		}
		else 
			return "";
	}
	
	function testArray($arr)
	{
		if(is_array($arr) && sizeof($arr) >0)
			return true;
		else 
			return false;
	}
	
	function escape($str)
	{
		return mysql_escape_string($str);
	}	
	
	
		/**
	 * Redirect 
	 *
	 * @param	any variable
	 * @return	void
	 */
	function redirect($url) 
	{
		$str = "
				<html>
					<body>
						<script language='JavaScript1.1'>
							location.href='$url';
						</script>
					</body>
				</html>
			";
		if(!headers_sent())
		{	
			header("Location: $url");
			echo $str;
			exit;
		}
		else 
		{
			
			echo $str;
		}
		exit;
	}
	
	
	
	function isLogin($r = false)
	{
		
		if($_SESSION['login']['id'] > 0 && $_SESSION['login']['status'] == 'E' )
		{
			return $_SESSION['login']['id'];
		}
		elseif($r) 
		{
			redirect(_FULL_URL."admin/?case=login");
		}
		return 0;		
	}
	
	
	
?>
Return current item: Universal comment module