天天看點

在同一頁面處理送出代碼

可用Request.ServerVariables("Request_Method")="POST"判斷是否送出,如下dice.asp頁面

<html>

    <head><title>測試Request_Method</title></head>

    <body>

    <%

        Session("point")=6

        If Request.ServerVariables("Request_Method")="POST" then

    %>

    <form method="POST" action="dice.asp">

    <p>當色子的面數為<input type="text" name="T1" size="5" value=<%=session("point") %>>時</p>

    <p><input type="submit" value="擲色子" name="B1"></p>

    </form>

    <p>擲色子的結果為:5點</p>

        Else

        end if

    </body>

</html>

繼續閱讀