当前位置:编程学习 > php >>

php简单提示框alert封装函数

答案:
复制代码 代码如下:

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

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

上一个:PHP 数组基础知识小结
下一个:一道求$b相对于$a的相对路径的php代码

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,