<?php
session_start();
if($_SESSION["tm_admin"]=="")
{
echo "<script>top.location.href='admin/index.php';</script>";
exit();
}
function request_uri() 
{ 
if (isset($_SERVER['REQUEST_URI'])) 
{ 
$uri = $_SERVER['REQUEST_URI'];
} 
else 
{ 
if (isset($_SERVER['argv']))
{ 
$uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['argv'][0]; 
} 
else 
{ 
$uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING'];
} 
} 
$temp=array();
$temp=explode("/",$uri);
$uri="";
for($i=0;$i<(count($temp)-1);$i++)
    $uri.=$temp[$i]."/";
return $uri;
}
function _get($str){  
$val = !empty($_GET[$str]) ? $_GET[$str] : null;  
return $val;  
}
function _post($str){  
$val = !empty($_POST[$str]) ? $_POST[$str] : null;  
return $val;  
}
?>