《PHP實(shí)例:Laravel實(shí)現(xiàn)表單提交》要點(diǎn):
本文介紹了PHP實(shí)例:Laravel實(shí)現(xiàn)表單提交,希望對(duì)您有用。如果有疑問(wèn),可以聯(lián)系我們。
首先,先做一個(gè)簡(jiǎn)單的表單頁(yè)面PHP編程
<html> <head> </head> <body> <form action="/submit" method="post"> <input type="text" name="a"></input> <input type="text" name="b"></input> <input type="text" name="c"></input> <input type="submit"></input> </form> </body> <html>
編輯一條路由PHP編程
Route::post('/submit','FormController@store');
創(chuàng)建一個(gè)控制器PHP編程
<?php namespace App\Http\Controllers; //use Illuminate\Http\Request; use App\Http\Requests; use Request; class FormController extends Controller { public function store(){ //var_dump(Request::all()); $input=Request::all(); echo $input['a'].PHP_EOL; echo $input['b'].PHP_EOL; echo $input['c'].PHP_EOL; } }
轉(zhuǎn)載請(qǐng)注明本頁(yè)網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/828.html