/*
* 功能:在页面上通过JS提示指定消息,并结束页面执行
* 参数:
* Msg :待显示的消息
* URL :需指定返回的页面,不指定时返回前一页
* 作者:itlearner
*/
function ShowMsg($Msg, $URL = "")
{
//header('Content-Type: text/html; charset=utf-8');
//echo '<meta http-equiv="Content-Type" content="text/html; charset=gbk" />';
echo "<script type=\"text/javascript\">";
if (strlen($Msg) > 1)
echo "alert(\"$Msg\");";
if ($URL == "")
echo "history.go(-1);";
else
echo "document.location.href=$URL;";
echo "</script>";
exit();
}[CODE_LITE]