以下是在環境wamp下執行的,php5.4.3下的操作練習。重點是php部分的**可以直接拿來用,樣式和js比較多,未引用
login.php部分
操作部分login.php<?php
//生成四位的隨機驗證碼
$codedata ="abcdqwetyuipffhbcnvmklabcdhfuncyeijndf0123456789";
$postcode = "";
for($i=0;$i
<4;$i++)."";
}?>
lang="zh-cn">
charset=utf-8" />
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
name="renderer"
content="webkit">
登入title>
rel="stylesheet"
href="css/pintuer.css">
rel="stylesheet"
href="css/admin.css">
src="js/jquery.js">
script>
src="js/pintuer.js">
script>
type="text/css">
.code
style>
head>
class="bg">
div>
class="container">
class="line bouncein">
class="xs6 xm4 xs3-move xm4-move">
style="height:150px;">
div>
class="media media-y margin-big-bottom">
div>
action="./php/login.php"
method="post">
class="panel loginbox">
class="text-center margin-big padding-big-top">
後台管理系統h1>
div>
class="panel-body"
style="padding:30px; padding-bottom:10px; padding-top:10px;">
class="form-group">
class="field field-icon-right">
type="hidden"/>
type="text"
class="input input-big"
name="username"
placeholder="登入賬號"
data-validate="required:請填寫賬號" />
class="icon icon-user margin-small">
span>
div>
div>
class="form-group">
class="field field-icon-right">
type="password"
class="input input-big"
name="password"
placeholder="登入密碼"
data-validate="required:請填寫密碼" />
class="icon icon-key margin-small">
span>
div>
div>
class="form-group">
class="field">
type="hidden"
name="postcode"
value="<?php echo strip_tags($postcode);?>">
type="text"
class="input input-big"
name="code"
placeholder="填寫右側的驗證碼"
data-validate="required:請填寫右側的驗證碼"
style="float: left;width: 270px;"/>
<?php
echo
$postcode; ?>
div>
div>
href="submit.html"
target="_blank"
style="float:right;margin-top:5px;">沒有帳號?註冊新使用者a>
div>
style="margin-top:6px;padding:30px;">
type="submit"
class="button button-block bg-main text-big input-big"
value="登入">
div>
div>
form>
div>
div>
div>
body>
html>
<?php
header("content-type:text/html;charset=utf-8");
require_once('../../connect.php');
if(!empty($_post))
}else
}?>
PHP的簡單登入操作
相對來講啊 這個登入後台就簡單一點,其實程式差不多,關鍵就是出現了幾點變化 第乙個還是關鍵的理清執行邏輯 1,拿到字段 使用者名稱 密碼 2,查詢使用者名稱存不存在 不存在的話返回提示,使用者名稱不存在 3,存在查詢密碼正不正確,不正確返回提示 密碼錯誤 4,使用者名稱密碼正確 跳轉到成功頁面 第二...
登入表單(入門簡單)
簡單入門的表單登入頁面練習 1 doctype html 2 html lang en 3 head 4 meta charset utf 8 5 meta name author content superdrew 6 meta name description content form vali...
PHP簡單傳表單
php 中獲取表單中單選按鈕的值 單選按鈕只能讓我們選擇乙個,這裡有乙個 checked 屬性,這是用來預設選取的,我們每次重新整理我們的頁面時就預設為這個值。例 name myform action method post 性別 type radio name value 男 checked 男 ...