form表单通过submit提交到控制器显示"404 Not Found!"

浏览:1331 发布日期:2020/05/26 分类:ThinkPHP6专区 关键字: thinkphp6输入变量显示404 Not Found!
前端form表格提交数据到后台控制器,路径方法均无误,但页面显示404 Not Found!,求大佬指点

前端代码:
<form action="{:url('Test/checkLogin')}" method="post">
<input type="text" placeholder="输入用户名" maxlength="25" name="username">
<input type="text" placeholder="输入密码" maxlength="25" name="password">
<!-- <button type="submit" name="submit">登陆</button> -->
<input type="submit" name="submit" value="登录">
</form>

后端代码:

class Test extends baseController
{

public function checkLogin()
{
echo "数据来到了这里";
$data = input('post.');
print_r($data);die();
}
}

运行结果显示:
能到该控制器,但未经过该方法同时显示404
404 Not Found!

附件 bug2.png ( 8.89 KB 下载:8 次 )

最佳答案
评论( 相关
后面还有条评论,点击查看>>