首页 > 开发 > PHP > 正文

php简单提示框alert封装函数

2024-05-04 22:08:46
字体:
来源:转载
供稿:网友
代码如下:
/*—————————————————— */
//– 简单提示框函数
/*—————————————————— */
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>';
}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表