php常用自建函数学习(4):ShowMsg返回弹出信息并进行返回、跳转、刷新等操作
if(!function_exists('ShowMsg'))
{
function ShowMsg($msg='', $gourl='-1')
{
if($gourl == '-1')
echo '<script>alert("'.$msg.'");history.go(-1);</script>';
else if($gourl == '0')
echo '<script>alert("'.$msg.'");location.reload();</script>';
else
echo '<script>alert("'.$msg.'");location.href="'.$gourl.'";</script>';
}
}
浙公网安备 33010602011771号