这个是login.html源码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form method="post">
<input type="text" name="username">
<input type="text" name="password">
<input type="submit" value="提交">
</form>
</body>
</html>
这个是login.php源码
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/1/18
* Time: 20:45
*/
$username = isset($_POST['username']) ? trim($_POST['username']) : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
echo $username;
echo '<br>';
echo $password;
require 'login.html';
?>
让我无法理解的是,为什么在login.php中直接用
$username = trim($_POST['username']);
$password = $_POST['password'];
就会报错 求解
侃侃无极
临摹微笑
红糖糍粑
潇潇雨雨
达令说
收到一只叮咚