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>';
	}
}

posted on 2020-02-11 18:49  漏刻有时  阅读(84)  评论(0)    收藏  举报