表单提交 设置Route::post报错
Route::post('/admin/loginTo','AdminController@loginTo');
<form action="/admin/loginTo/" onsubmit="return checkForm()" method="post" target="_blank">
<div class="info"></div>
<div class="input"><i id="i_admin_user">用户名</i><input type="text" id="admin_user" name="admin_user" class="text" style="width:200px;" /></div>
<div class="input"><i id="i_admin_password">密码</i><input type="password" id="admin_password" name="admin_password" class="text" style="width:200px;" /></div>
<div class="input"><input type="submit" value="登录" class="button-blue" style="width:70px;" /></div>
</form>
报错
Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException
什么原因
<form action="/admin/loginTo/" onsubmit="return checkForm()" method="post" target="_blank">
<div class="info"></div>
<div class="input"><i id="i_admin_user">用户名</i><input type="text" id="admin_user" name="admin_user" class="text" style="width:200px;" /></div>
<div class="input"><i id="i_admin_password">密码</i><input type="password" id="admin_password" name="admin_password" class="text" style="width:200px;" /></div>
<div class="input"><input type="submit" value="登录" class="button-blue" style="width:70px;" /></div>
</form>
报错
Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException
什么原因
1 个回复
00幽靈00 - 略知一二,不求甚解
赞同来自:
form 里是 "/admin/loginTo/",
为什么这么写呢?