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

Login page for developing simple voting system with PHP

The administrator login page is in the admin.php file

114.png

##Use a <form> form to create a login front-end page

<form action="" method="post">
  <table width="" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#C2C2C2">
    <tr>
      <td height="30" align="right" bgcolor="#FFFFFF"><label>輸入密碼:</label></td>
      <td align="left" bgcolor="#FFFFFF"><input name="pwd" type="text" id="pwd" /></td>
    </tr>
    <tr>
      <td height="30" colspan="2" align="center" bgcolor="#FFFFFF"><label>
          <input name="Submit10" type="submit" id="Submit10" value="登陸" />
        </label>
        <label> &nbsp;
          <input type="reset" name="Submit5" value="重置" />
        </label></td>
    </tr>
    <tr>
      <td height="30" colspan="2" align="center" bgcolor="#FFFFFF">
      </td>
    </tr>
  </table>
</form>

give Login<input> an id value

id="Submit10", here we set a login password$pwd = admin,

Friends enter admin directly You can log in to the

administrator operation page.

The password pwd value obtained using POST method matches the pwd value of SESSION. If the password entered in the <input> text box is admin, the login is successful and you will jump to Operation page; otherwise it will prompt login failure.

<?php
if(isset($_POST['Submit10'])){
  if($_POST['pwd']=='admin'){

    $_SESSION['pwd']=2;

    echo "<script language=javascript>alert('登陸成功!');window.location='admin.php'</script>";
  }else{
    echo "<script language=javascript>alert('登陸失敗,請檢查您的密碼!');window.location='admin.php'</script>";
  }
}
?>
Continuing Learning
||
?<form action="" method="post"> <table width="" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#C2C2C2"> <tr> <td height="30" align="right" bgcolor="#FFFFFF"><label>輸入密碼:</label></td> <td align="left" bgcolor="#FFFFFF"><input name="pwd" type="text" id="pwd" /></td> </tr> <tr> <td height="30" colspan="2" align="center" bgcolor="#FFFFFF"><label> <input name="Submit10" type="submit" id="Submit10" value="登陸" /> </label> <label>   <input type="reset" name="Submit5" value="重置" /> </label></td> </tr> <tr> <td height="30" colspan="2" align="center" bgcolor="#FFFFFF"> </td> </tr> </table> </form>
submitReset Code