当前位置:Gxlcms > PHP教程 > php简单提示框alert封装函数

php简单提示框alert封装函数

时间:2021-07-01 10:21:17 帮助过:15人阅读

代码如下:

/*—————————————————— */
//– 简单提示框函数
/*—————————————————— */
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>';
}

人气教程排行