Home>

This article shares a simple example of how to implement form submission in the process of using laravel,very simple,Here is recommended for children who are learning laravel

First, make a simple form page

<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>

Edit a route

route ::post ("/submit", "[email protected]");

Create a controller

<?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;
}
}
php
  • Previous Android ViewonMeasure method explained and examples
  • Next Use and implementation of ng-include directive in AngularJs