Home > php教程 > PHP源码 > body text

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

PHP中文网
Release: 2016-05-25 17:05:28
Original
1435 people have browsed it

[代码]           

//********弹出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();
}
Copy after login

                   

                   

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template