【问题标题】:@csrf considered as normal html text@csrf 被视为普通的 html 文本
【发布时间】:2021-10-14 11:52:29
【问题描述】:

我通常在 <form></form> 上使用 @csrf 来绕过 Laravel 上的“页面已过期”消息,但现在由于某种原因,它被认为只是普通的 html 文本而不是代码。我的意思是“@csrf”字面上显示在网页上。有谁知道这个问题?但它在其他表单上正常工作

    <form method="POST" action="/user/usulan/post">
        @csrf
        <input type="text" name="nama" placeholder="Nama" required>
        <input type="text" name="tlp1" placeholder="tlp1" required>
        <input type="text" name="tlp2" placeholder="tlp2" required>
        <input type="text" name="usulan" placeholder="usulan" required>
        <button>Submit</button>
    </form>

【问题讨论】:

    标签: php html laravel


    【解决方案1】:

    确保您的视图文件具有.blade.php 扩展名。

    【讨论】:

      猜你喜欢
      • 2012-02-14
      • 2013-03-14
      • 2010-09-18
      • 1970-01-01
      • 2013-07-24
      • 1970-01-01
      • 1970-01-01
      • 2013-04-03
      • 2012-12-03
      相关资源
      最近更新 更多