Home  >  Article  >  php教程  >  非常实用的php弹出错误警告函数

非常实用的php弹出错误警告函数

PHP中文网
PHP中文网Original
2016-05-25 17:05:281436browse

[代码]           

//********弹出alert框并跳转到指定页面******//
function alert($message,$url='',$isAlert=true,$title='提示'){
	echo &#39;<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>&#39;,$title,&#39;</title></head><body>&#39;;
	echo &#39;<script type="text/javascript">&#39;;
	echo $isAlert?&#39;alert("&#39;.$message.&#39;");&#39;:&#39;&#39;;
	echo $url==&#39;&#39;?&#39;history.back();&#39;:&#39;location.href="&#39;.$url.&#39;";&#39;;
	echo &#39;</script>&#39;;
	echo &#39;</body></html>&#39;;
	exit();
}

                   

                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn