Background Management Section. index.php
1. Check the cokkies to determine if you are logged in. logged in from jump to post.php
2. Check the submission information to determine if the account and password are correct. Right jump to post.php
3. Some page layouts and user name and password input boxes also have a Submit button.
1<?PHP2 require_once dirname(dirname(__file__)).‘ /files/conf.php ';3 if(isset($_cookie[' Mc_token ']) {//Check the cookies to determine if they are logged in4 $token=$_cookie[' Mc_token '];5 if($token==MD5($MC _config[' user_name ']. ' _‘.$MC _config[' User_pass '])) {6 Header("Location:post.php");7 }8 }9 if(isset($_post[' Login ']) {//Check whether the Submit button is clickedTen if($_post[' user '] = =$MC _config[' User_name '] One&&$_post[' pass '] = =$MC _config[' User_pass ']) { A Setcookie(' Mc_token ',MD5($MC _config[' user_name ']. ' _‘.$MC _config[' User_pass '])); - Header("Location:post.php"); - } the } -?> -<! DOCTYPE html> - + -<meta charset= "UTF-8"/> +<title> Background Management </title> A<style type= "Text/css" > at* {font-family: "Microsoft Yahei",Arial;} -Body {background:#f9f9f9; font-size:14px;} - #login_title {text-align:center; width:360px; margin:120px auto; margin-bottom:0px; font-size:32px; color: #333; text-shadow:0 2px 0 #FFFFFF;} - #login_form {width:360px; margin:0 auto; margin-top:20px; border:solid 1px #e0e0e0; background: #fff; Border-radius : 3px 3px 3px 3px;} - #login_form_box {padding:16px;} - #login_form. label {font-weight:bold; padding-bottom:6px; color: #333;} in #login_form. TextBox input {border:none; padding:0; font-size:24px; width:312px; color: #333;} - #login_form. textbox {border:1px solid #e0e0e0; padding:6px; margin-bottom:20px; border-radius:3px 3px 3px 3px;} to #login_form. Bottom {text-align:right;} + #login_form. button {padding:8px 16px; font-size:14px;} -</style> the *<body> $<form action= "<?php Echo$_server[' Request_uri '];?> "method=" POST ">Panax Notoginseng<div id= "Login_title" > Login background </div> -<div id= "Login_form" > the<div id= "Login_form_box" > +<divclass= "Label" > Account </div> A<divclass= "TextBox" ><input name= "user" type= "text"/></div> the<divclass= "label" > Password </div> +<divclass= "TextBox" ><input name= "pass" type= "password"/></div> -<divclass= "Bottom" ><input name= "Login" type= "submit" value= "Login"class= "button"/></div> $</div> $</div> -</form> -</body> the"Blog Fan" (BLOGMI) source reading [4]