亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP開(kāi)發(fā) 小型論壇教學(xué)登入HTML頁(yè)面

我們的登入頁(yè)面使用了<table>表格進(jìn)行佈局

加上一些簡(jiǎn)單的CSS樣式,最終的效果如下圖

log.jpg

##我們?yōu)榈卿涰?yè)面做了簡(jiǎn)單的JS判斷,如果使用者名稱和密碼沒(méi)有填寫(xiě)登錄,會(huì)給予相關(guān)的提示資訊

具體程式碼如下

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用戶登錄</title>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登陸界面</title>
    <script type="text/javascript">
        function foo(){
            if(myform.username.value=="")
            {
                alert("請(qǐng)輸入用戶名");
                myform.username.focus();
                return false;
            }
            if (myform.password.value=="")
            {
                alert("請(qǐng)輸入密碼");
                myform.password.focus();
                return false;
            }
        }
    </script>
    <style type="text/css">
        table{
            height: 300px;
        }
        input{
            width: 190px;
            height: 25px;
        }
        .title{
            background-color:#B10707 ;
            color: white;
            border: none;
        }
        .but{
            width: 140px;
            height: 43px;
        }
        .spa{
            margin-left: 10px;
        }
    </style>
</head>
<body>
<form action="login.php"  method="post" onsubmit="return foo();" name="myform" >
    <table width="400px" border="1" cellpadding="12" cellspacing="1" align="center">
        <tr>
            <td colspan="2" class="title">會(huì)員登錄<span class="spa">[<a style="color: white"  href="index.php">返回首頁(yè)]</a></span></td>
        </tr>
        <tr>
            <td width="110px">會(huì)員ID</td>
            <td><input type="text" name="username"></td>
        </tr>
        <tr>
            <td width="110px">會(huì)員密碼</td>
            <td><input type="password" name="password"></td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <button class="but" style="text-align: center">立即登錄</button>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
</body>
</html>

將我們?cè)陧?yè)面填寫(xiě)的資訊提交到login.php頁(yè)面處理


繼續(xù)學(xué)習(xí)
||
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>用戶登錄</title> </head> <body> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>登陸界面</title> <script type="text/javascript"> function foo(){ if(myform.username.value=="") { alert("請(qǐng)輸入用戶名"); myform.username.focus(); return false; } if (myform.password.value=="") { alert("請(qǐng)輸入密碼"); myform.password.focus(); return false; } } </script> <style type="text/css"> table{ height: 300px; } input{ width: 190px; height: 25px; } .title{ background-color:#B10707 ; color: white; border: none; } .but{ width: 140px; height: 43px; } .spa{ margin-left: 10px; } </style> </head> <body> <form action="login.php" method="post" onsubmit="return foo();" name="myform" > <table width="400px" border="1" cellpadding="12" cellspacing="1" align="center"> <tr> <td colspan="2" class="title">會(huì)員登錄<span class="spa">[<a style="color: white" href="index.php">返回首頁(yè)]</a></span></td> </tr> <tr> <td width="110px">會(huì)員ID</td> <td><input type="text" name="username"></td> </tr> <tr> <td width="110px">會(huì)員密碼</td> <td><input type="password" name="password"></td> </tr> <tr> <td colspan="2" align="center"> <button class="but" style="text-align: center">立即登錄</button> </td> </tr> </table> </form> </body> </html> </body> </html>
提交重置程式碼