表单提交后台获取不了数据
页面:
<form action="{{ action('IndexController@index') }}" method="post" id="form">
<b>商品名称<b><input type="text" name="title"><br><br>
分类<select name="category">
<option value="clothes">衣服</option>
<option value="pants">裤子</option>
<option value="shoes">鞋子</option>
<option value="package">包类</option>
</select><br><br>
价格<input type="text" name="price"><br><br>
折扣<input type="text" name="discount"><br><br>
介绍<textarea rows="" cols="" name="intro"></textarea><br><br>
<input type="submit" name="add" value"添加">
</form>
php后台:
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Input;
//use Illuminate\Support\Facades\Input;
//use App\Http\Requests\IndexGoodPostRequest;
class IndexController extends Controller{
public function index() {
if($input=Input::all()){
dd($input);
}
else {
return view('addGood');
}
}
}
在界面输入数据点击添加后页面没有dd()出数据
<form action="{{ action('IndexController@index') }}" method="post" id="form">
<b>商品名称<b><input type="text" name="title"><br><br>
分类<select name="category">
<option value="clothes">衣服</option>
<option value="pants">裤子</option>
<option value="shoes">鞋子</option>
<option value="package">包类</option>
</select><br><br>
价格<input type="text" name="price"><br><br>
折扣<input type="text" name="discount"><br><br>
介绍<textarea rows="" cols="" name="intro"></textarea><br><br>
<input type="submit" name="add" value"添加">
</form>
php后台:
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Input;
//use Illuminate\Support\Facades\Input;
//use App\Http\Requests\IndexGoodPostRequest;
class IndexController extends Controller{
public function index() {
if($input=Input::all()){
dd($input);
}
else {
return view('addGood');
}
}
}
在界面输入数据点击添加后页面没有dd()出数据
2 个回复
iwen
赞同来自:
那人好像一条狗
赞同来自: