日期:2014-05-16  浏览次数:20501 次

自己写了一个跳转函数一直在报错
<?php
/**
 * ShowMsg()返回信息定向函数
 */
function ShowMsg($_info,$_url)
If $_url="" Then 
echo "<script type='text/javascript'>alert('$_info');history.back();</script>"
Else 
If $_info="" Then 
header('Location:'.$_url);
else
echo "<script type='text/javascript'>alert('$_info');location.href='$_url';</script>";
End If
End If


?>

------解决方案--------------------
function ShowMsg($_info,$_url){
    If ($_url==""  ){
        echo "<script type='text/javascript'>alert('$_info');history.back();</script>";
    }Else{ 
        If ($_info=="") 
            header('Location:'.$_url);
        else
            echo "<script type='text/javascript'>alert('$_info');location.href='$_url';</script>";
        
    }
}