Home  >  Article  >  类库下载  >  PHP control layer page prompt method

PHP control layer page prompt method

高洛峰
高洛峰Original
2016-10-20 14:34:591378browse

showMessage方法

 /**
     * Alert show message
     * @param string $message
     * @param string $mode 跳转地址
     * @return void
     */
    function showMessage($message, $mode = "back")
    {
        ob_start();
        if($mode == "back")
        {
            $cmd = "history.go(-1)";
        }
        else
        {
            $cmd = "location.href = '" . $mode . "';";
        }

        echo &#39;<script language="javascript">
        <!--
            alert("&#39; . $message . &#39;");&#39; . $cmd . &#39;
        -->
            </script>&#39;;

        ob_end_flush();
        exit();
    }


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:set collection typeNext article:set collection type

Related articles

See more