if ( ! function_exists('error'))
{
    /**
     * 错误跳转
     */
    function error($mes, $url)
    {
        echo '<script type="text/javascript">alert("'.html_escape($mes).'");history.back();</script>';
        exit();
    }
}

// ------------------------------------------------------------------------

if ( ! function_exists('success'))
{
    /**
     * 成功跳转
     */
    function success($mes, $url)
    {
        echo '<script type="text/javascript">alert("'.html_escape($mes).'");window.location.href="'.$url.'";</script>';
        exit();
    }
}

相关文章: