Login page for developing simple voting system with PHP
The administrator login page is in the admin.php file

<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>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 theadministrator 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>";
}
}
?>
new file
<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>
Preview
Clear
- Course Recommendations
- Courseware download
The courseware is not available for download at the moment. The staff is currently organizing it. Please pay more attention to this course in the future~
Students who have watched this course are also learning
Let's briefly talk about starting a business in PHP
Quick introduction to web front-end development
Large-scale practical Tianlongbabu development of Mini version MVC framework imitating the encyclopedia website of embarrassing things
Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum]
Login verification and classic message board
Computer network knowledge collection
Quick Start Node.JS Full Version
The front-end course that understands you best: HTML5/CSS3/ES6/NPM/Vue/...[Original]
Write your own PHP MVC framework (40 chapters in depth/big details/must read for newbies to advance)
















