laravel 5 - 403错误的表格帖子

时间:2016-06-16 00:00:23

标签: php forms laravel post http-status-code-403

良好的叠加人流,

以下通用表单无法正确发布,返回403禁止错误。

然而,当一个人从value=字段中删除随机的文本块时,它就可以发布。

<form method="POST" action="http://domain.com/generic" accept-charset="UTF-8">

<input type="hidden" name="items" value="[{&quot;sku&quot;:&quot;ttwvslyvjblc&quot;,&quot;name&quot;:&quot;5 on 5 - 1 hour indoor (Loose Cannons)&quot;,&quot;price&quot;:14,&quot;quantity&quot;:1,&quot;detail&quot;:{&quot;utc_offset&quot;:36000000,&quot;venue&quot;:{&quot;country&quot;:&quot;au&quot;,&quot;localized_country_name&quot;:&quot;Australia&quot;,&quot;city&quot;:&quot;Kensington&quot;,&quot;address_1&quot;:&quot;Corner of Kensington Road and Altona Street&quot;,&quot;name&quot;:&quot;YMCA Kensington Community Recreation Centre &quot;,&quot;lon&quot;:144.924556,&quot;id&quot;:1412922,&quot;lat&quot;:-37.795941,&quot;repinned&quot;:false},&quot;rsvp_limit&quot;:14,&quot;headcount&quot;:0,&quot;visibility&quot;:&quot;public_limited&quot;,&quot;waitlist_count&quot;:0,&quot;created&quot;:1461736046000,&quot;fee&quot;:{&quot;amount&quot;:14,&quot;accepts&quot;:&quot;paypal&quot;,&quot;description&quot;:&quot;per person&quot;,&quot;currency&quot;:&quot;AUD&quot;,&quot;label&quot;:&quot;Price&quot;,&quot;required&quot;:&quot;1&quot;},&quot;maybe_rsvp_count&quot;:0,&quot;description&quot;:&quot;<p>*Please note that this session is for advanced players only with the title Loose Cannons*</p> <p>Each week we play a friendly competitive game of basketball. There is a half time break of 2 mins where teams have the chance to discuss strategies. We have a 4 minute substitution which is notified with a whistle. Maximise your fitness each game while we pump some tunes!</p> <p>Points are totalled and the team with the most wins.</p> <p>Some of our members are casual, while many are regular, this creates a dynamic mix of friends and new faces, this <a href=\&quot;http://www.basketball613.com.au/code-of-conduct/\&quot;>culture</a> is what separates Basketball613 apart from standard league competition basketball.</p> <p>The rules are refereed by the players, for the players. We use the FIBA rule system.</p> <p>Coloured sashes are provided to players to identify which team you'r on, so you just need to bring comfortable clothes.</p> <p>If you are attending a game for the first time, you will be allocated to the Intermediate/beginners session to start of with. We will then assess and allocate you to the appropriate skill level game after your first game. To find out which group you have been allocated to, please view your profile title before you book in your next session. When you arrive ask reception where the basketball courts are.</p> <p>Payment is made online, preferably 1 week in advance.</p> <p>Facilities: Showers, Parking, Trains, Drinking Water.</p>&quot;,&quot;how_to_find_us&quot;:&quot;When you arrive ask reception where the basketball courts are.&quot;,&quot;event_url&quot;:&quot;http://www.meetup.com/basketball613/events/231502076/&quot;,&quot;yes_rsvp_count&quot;:6,&quot;duration&quot;:3600000,&quot;announced&quot;:false,&quot;name&quot;:&quot;5 on 5 - 1 hour indoor (Loose Cannons)&quot;,&quot;id&quot;:&quot;ttwvslyvjblc&quot;,&quot;time&quot;:1467104400000,&quot;updated&quot;:1461817693000,&quot;group&quot;:{&quot;join_mode&quot;:&quot;open&quot;,&quot;created&quot;:1358743637000,&quot;name&quot;:&quot;Melbourne Basketball 613&quot;,&quot;group_lon&quot;:144.96000671387,&quot;id&quot;:6760582,&quot;urlname&quot;:&quot;basketball613&quot;,&quot;group_lat&quot;:-37.810001373291,&quot;who&quot;:&quot;Ballers&quot;},&quot;status&quot;:&quot;upcoming&quot;,&quot;numspotsleft&quot;:8,&quot;url&quot;:&quot;http://api.basketball613.com.au/members-area/event/ttwvslyvjblc&quot;,&quot;date&quot;:{&quot;date_usa&quot;:&quot;06-28-2016&quot;,&quot;date_aus&quot;:&quot;28-06-2016&quot;,&quot;time&quot;:&quot;07:00pm&quot;,&quot;day&quot;:&quot;28&quot;,&quot;monthname&quot;:&quot;Jun&quot;,&quot;dayname&quot;:&quot;Tuesday&quot;},&quot;quantity&quot;:1}}]">           
<input class="btn btn-flat btn-success" type="submit" value="Checkout to play!">  
</form>

路线有效:

Route::post('/generic', function() {
        dd('ok!');
});

注意:我已禁用csrf来隔离问题。

为什么我无法接收发布的输入项?

为什么会创建403 Forbidden Access to this resource on the server is denied!

2 个答案:

答案 0 :(得分:0)

为您的路线:

 route::post('generic',['as' => 'generic'],function() {


});

您的表单代码:

<form method="POST" action="{{route('generic')}}" accept-charset="UTF-8">

<input type="hidden" name="items" value="your value">           
<input class="btn btn-flat btn-success" type="submit" value="Checkout to play!">  
</form>

我希望能帮到你

答案 1 :(得分:0)

这在服务器上是一个问题。

mod_security已在某个时候更新,域名需要列入白名单。