VerifyCsrfToken.php第53行中的TokenMismatchException:laravel 5.1中的(Firefox浏览器)? [英] TokenMismatchException in VerifyCsrfToken.php line 53:(Firefox browser) in laravel 5.1?
问题描述
我试图弄清楚这个错误的原因,尽管它是全新安装的.我在我的项目中遇到了这个错误,所以我用谷歌搜索,没有一个答案对我有用.所以我创建了一个新项目,并复制了所有控制器,视图和model.its在几个小时后再次出现令牌不匹配错误后仍能正常工作.为什么在laravel中会发生这种情况?
i am trying to figure out why this error even though its fresh installation.i got this error in my project so i googled ,none of the answers worked for me.so i created new project and copied all controller ,view, and model.its worked fine after few hours once again token mismatch error.why this happen in laravel ?
我的表格
<form class="form-horizontal action="http://localhost/laravel/public/add-post-new" enctype="multipart/form-data" method="POST" accept-charset="UTF-8" >
<div class="form-group">
<label for="inputEmail" class="control-label col-xs-2">Title</label>
<div class="col-xs-10">
<input type="text" class="form-control" id="post_title" placeholder="Title" name="post_title">
</div>
</div>
<div class="form-group">
<label for="inputPassword" class="control-label col-xs-2">Content</label>
<div class="col-xs-10"><textarea class="form-control" style="resize:none" rows="25" name="post_content"></textarea>
</div>
</div>
<div class="form-group">
<label for="inputPassword" class="control-label col-xs-2">Featured Image</label>
<div class="col-xs-10"><input type="file" class="filestyle" data-buttonText="Find" name="featured_image">
</div>
</div>
<div class="form-group">
<label for="inputPassword" class="control-label col-xs-2">Post Images</label>
<div class="col-xs-10"><input type="file" class="filestyle" name="post_gallery[]" multiple />
</div>
</div>
<div class="form-group">
<label for="inputPassword" class="control-label col-xs-2">Select Category</label>
<div class="col-xs-10" >
<select class="form-control" name="cat_id">
<?php $data=Category::all(); ?>
<option value="0">Default Category</option>
@foreach($data as $value)
<option value="{{$value->id}}">{{$value->cat_name}}</option>
@endforeach
</select>
</div>
</div>
<div class="form-group">
<label for="inputPassword" class="control-label col-xs-2">Publish Post</label>
<div class="col-xs-10">
<label class="radio-inline">
<input type="radio" name="published" id="inlineRadio1" value="1"> Publish
</label><br>
<label class="radio-inline">
<input type="radio" name="published" id="inlineRadio2" value="2"> UnPublish
</label><br>
<label class="radio-inline">
<input type="radio" name="published" id="inlineRadio2" value="3"> Draft
</label><br><br>
</div>
</div>
<div class="form-group">
<label for="inputPassword" class="control-label col-xs-2">Slider Post</label>
<div class="col-xs-10">
<label class="radio-inline">
<input type="radio" name="slider_post" id="inlineRadio1" value="1"> Slider Post
</label><br>
<label class="radio-inline">
<input type="radio" name="slider_post" id="inlineRadio2" value="2"> Not required
</label><br><br>
</div>
</div>
<div class="form-group">
<div class="col-xs-offset-2 col-xs-10">
<input name="_token" type="hidden" value="{{ csrf_token() }}"/>
<button type="submit" class="btn btn-primary">Submit Post</button>
</div>
</div>
在问问题之前,我已经阅读了许多教程
before asking question i have read many tutorial
Laravel 5,表单,VerifyCsrfToken.php行中的TokenMismatchException 46
Laravel 5 Auth Post Submit-VerifyCsrfToken中的TokenMismatchException .php第46行
Laravel的VerifyCsrfToken.php第53行中的TokenMismatchException 5.1
VerifyCsrfToken.php第46行中的TokenMismatchException
Laravel 5,ajax,500内部服务器错误,VerifyCsrfToken.php第46行中的TokenMismatchException:
VerifyCsrfToken.php第46行中的Laravel 5 TokenMismatchException
遇到"VerifyCsrfToken.php中的TokenMismatchException"错误
Laravel TokenMismatchException
http://laravel.io/forum/01 -30-2015-laravel5-tokenmismatchexception-in-verifycsrftoken
上传视频时出现TokenMismatchException吗?
已更新:
推荐答案
这可能会对某人有所帮助. 检查您的以空行或空格开头的php文件! 这花了我很多麻烦.包括上面的内容!
This may help someone. Check your php files that not start with empty line or space! It cost me much trouble. Including that above!
这篇关于VerifyCsrfToken.php第53行中的TokenMismatchException:laravel 5.1中的(Firefox浏览器)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!