Ayush Bansal
Ayush Bansal

Reputation: 485

POST method not working in laravel 5

**THIS is my code for form creation and action is set to post but it is showing error "tokenmismatchexception in verifycsrftoken.php line 53 laravel 5.1";

<html>
<body>
<form action="/abc" method="post">
    <b style="padding-right:110px;">Patient's Name:</b>   
    <input    type="text" name="fullname" required><br><br>
    <b style="padding-right:50px;">Required Blood Group:</b>                      
    <option>A+</option>
    <select>
        <option>B+</option>
        <option>AB+</option>
        <option>O+</option>
        <option>A-</option>
        <option>B-</option>
        <option>AB-</option>
        <option>O-</option>                                         
    </select><br><br>
    <input 
        type="submit" 
        style="position:absolute;right:170px;" 
        name="submit"
        value="Request">
</form>     
</body>
</html>

Upvotes: 0

Views: 333

Answers (1)

David Stromberg
David Stromberg

Reputation: 244

You need to include the CSRF token in your form data. Add:

<input type="hidden" name="_token" value="{{ csrf_token() }}">

right after your opening form tag.

Upvotes: 1

Related Questions