D
D
Dmitry Dremin2017-03-25 09:52:47
Laravel
Dmitry Dremin, 2017-03-25 09:52:47

Error working with Form POST?

Hello, I am new to both php and laravel, especially for this and such a simple question.
What I gave below, I repeated specifically from the lessons on Laravel, and the author succeeded!
There is this form:

<form action="/about" method="POST">
    Имя:
    <input type="text" name="name"/><br />
    Текст:<br />
    <textarea name="text"></textarea>
    <br />
    <input type="submit" value="Äîáàâèòü"/>
</form>

I make the output of information from the form to the route
Route::post('/about', function () {
    echo "<pre>";
    print_r($_POST);
    echo "</pre>";
});

As a result, on the page " domain.loc/about
e8bc2714c99140b68e358c5e1fbca3cb.png
" I get such a most unpleasant message: when using Route::match on the page " domain.loc/about " gives empty
Array() output:
Route::match(['GET', 'POST'], '/about', function()
{
    echo "<pre>";
    print_r($_POST);
    echo "</pre>";
});

Thanks for any response on the topic.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pushkarev, 2017-03-25
@dmidem

<form action="/about" method="POST">
    {{ csrf_field() }}
    ...
</form>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question