php简单提示框alert封装函数

 更新时间:2010年08月08日 17:47:44   作者:  
php自定义函数之简单提示框alert,方便输出提示信息。
复制代码 代码如下:

/*—————————————————— */
//– 简单提示框函数
/*—————————————————— */
function alert ($msg,$url=")
{
$str = '<script type="text/javascript">';
$str.="alert('".$msg."');";

if ($url != ")
{
$str.="window.location.href='{$url}';";
}
else
{
$str.="window.history.back();";
}
echo $str.='</script>';
}

相关文章

最新评论