<?php
switch( intval($_GET['ErrorCode']) )
{
    case 0:
        break;
    case 1:
        $html = <<<HTML
<SCRIPT ID=clientEventHandlersVBS language = VBScript>
<!--
    Dim TheForm
    Set TheForm = Document.form1
    MsgBox("密码输入错误,请重新输入!")
    TheForm.gonghao.Focus
-->
</SCRIPT>
HTML;
    echo $html;
    default:
        break;
}
?>

解决方案 »

  1.   

    落了个break;<?php
    switch( intval($_GET['ErrorCode']) )
    {
        case 0:
            break;
        case 1:
            $html = <<<HTML
    <SCRIPT ID=clientEventHandlersVBS language = VBScript>
    <!--
        Dim TheForm
        Set TheForm = Document.form1
        MsgBox("密码输入错误,请重新输入!")
        TheForm.gonghao.Focus
    -->
    </SCRIPT>
    HTML;
            echo $html;
            break;
        default:
            break;
    }
    ?>
      

  2.   

    我把代码贴到页面里一运行,在$html = <<<HTML的地方报了个Parse error的错误,还望指教,谢谢!
      

  3.   

    还有想把上述代码改成javascript,不知道行不行,还望指教,谢谢!
      

  4.   

    不会吧,我这没有错误。<?php
    $_GET['ErrorCode'] = 1;
    switch( intval($_GET['ErrorCode']) )
    {
        case 0:
            break;
        case 1:
            $html = <<<HTML
    <script language = JavaScript>
    <!--
        var theForm = document.form1;
        alert("密码输入错误,请重新输入!");
        theForm.gonghao.focus();
    -->
    </script>
    HTML;
            echo $html;
            break;
        default:
            break;
    }
    ?>