PHP in a simple landing page Case

[PHP in a simple landing page Case]


login.html file:

<html>
 <head>
  <meta charset="utf-8"/>
  <title>用户登陆</title>
 </head>
 <body>
  <form action="login.php" method="GET">
   姓名:<input type="text" name="username"/><br/>
   密码:<input type="password" name="pwd"/><br/>
   <input type="submit" value="登陆"/>
  </form>
 </body>
</html>

login.php file:

<?php
 //获取网页上的表单值
 $username = $_GET['username'];
 $pwd = $_GET['pwd'];
 //任意定义用户登陆名和密码
 $uname = '张三';
 $upwd = 123123;
 //判断登陆
 if($username==$uname && $pwd==$upwd){
  echo '登陆成功';
 }else{
  echo '登陆失败';

Login effect is as follows:
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

Published 15 original articles · won praise 10 · views 572

Guess you like

Origin blog.csdn.net/weixin_44439445/article/details/103040279