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

PHP control layer page prompt method

高洛峰
Release: 2016-10-20 14:34:59
Original
1471 people have browsed it

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();
    }
Copy after login


Related labels:
php
Statement of this Website
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
Latest Issues
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template