Effect:
Code:
<?php//Set the coded header ("content-type:text/html; Charset=utf-8 "); Receive submitted data//determine whether to accept the submitted form if (Isset ($_post[' submit '))) {$userarray = array (); $userarray [' useraccount '] = isset ($_post[' UserAccount ')? $_post[' useraccount ': null; $userarray [' userpassword '] = isset ($_post[' UserPassword ')? $_post[' userpassword ': null; $ismemory = isset ($_post[' ismemory ')? True:null; Determines whether the required parameter is empty foreach ($userarray as $user) {if ($user = = null) {echo ' argument is empty! ‘; Exit (); }}//Verify the account password if ($userarray ['] = = ' 123456 ' && $userarray ['] = = ' 123456 ') { Determine if the storage account if ($ismemory) {//Storage cookie//long-term effective setcookie (' Userac Count ', $userarray [' UserAccount ']); }//Login success, jump page header (' location:http://www.baidu.com '); }}?>Php-cookie applications