PHP開發(fā)之登錄頁面跳轉(zhuǎn)注冊(cè)頁
前面兩個(gè)章節(jié),我們已經(jīng)介紹了用戶注冊(cè)和登錄模塊功能實(shí)現(xiàn)。
這里通過簡(jiǎn)單的代碼在登錄頁面添加注冊(cè)鏈接
只需要在登錄頁面的HTML中加入<a>鏈接增加一些簡(jiǎn)單的CSS樣式即可實(shí)現(xiàn)頁面跳轉(zhuǎn)
<li> <input type="submit" value="登錄" name="do_submit"/> <a href="zhuce.html" style="text-decoration: none; padding-left: 30px;">注冊(cè)</a> </li>
完整代碼:
<!DOCTYPE html> <html> <head> <title>用戶登錄頁面</title> <meta charset="UTF-8"/> <style type="text/css"> *{margin:0px;padding:0px;} ul{ width:400px; list-style:none; margin:50px auto; } li{ padding:12px; position:relative; } label{ width:80px; display:inline-block; float:left; line-height:30px; } input[type='text'],input[type='password']{ height:30px; } img{ margin-left:10px; } input[type="submit"]{ margin-left:80px; padding:5px 10px; } </style> </head> <body> <form action="logins.php" method="post"> <ul> <li> <label>用戶名:</label> <input type="text" name="username" placeholder="請(qǐng)輸入登錄賬號(hào)"/> </li> <li> <label>密碼:</label> <input type="password" name="password" placeholder="請(qǐng)輸入密碼" /> </li> <li> <label>驗(yàn)證碼:</label> <input type="text" name="code" size="4" style="float:left"/> <a href="javascript:;" onclick="document.getElementById('captcha_img').src='captcha.php?r='+Math.random()"> <img id="captcha_img" border='1' src='captcha.php?r=echo rand(); ?>' style="width:100px; height:30px" /> </a> </li> <li> <input type="submit" value="登錄" /> <a href="zhuce.html" style="text-decoration: none; padding-left: 30px;">注冊(cè)</a> </li> </ul> </form> </body> </html>