如何保存变量并在另一个页面中使用这些变量


How to save variables and use these in another page?

我正在制作一个带有访客和管理员的网站。在管理方面,还有额外的页面,您可以在其中填写表单,其中包含其他页面中某些div的文本和标题。

想知道我怎样才能做到这一点,以便当您填写这些表单并按保存时,变量将在另一个页面中使用,您可以在其中实际看到标题和文本为 html。文本和标题必须对访问该页面的每个人都可见,并且必须保留在那里,直到进行更改为止。

还没有代码,因为我不知道如何开始,我确实有接口,你可以在这里看到 HTML。

接口输入:

   <div class="panel-box">
    <div class="titles">
        <h4>Voeg vacatures toe</h4>
    </div>
    <form class="form-theme">
        <div class="row">
            <div class="form-group">
                <div class="col-md-12">
                    <label for="name">Titel vacature</label>
                    <input type="text"  required="required" value="" maxlength="100" class="form-control" name="Name" id="name">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="form-group">
                <div class="col-md-12">
                    <label for="description">Beschrijving</label>
                    <textarea rows="10" class="form-control" name="description" id="description" required="required" ></textarea>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <input type="submit" value="Save" class="btn btn-lg btn-primary">
            </div>
        </div>
    </form>
</div>

输出:

  <!-- Content Central -->
    <div class="container padding-top">
        <div class="row">
            <!-- content Column Left -->
            <div class="col-md-12">
                <!-- Experts -->
                <div class="panel-box">
                    <div class="titles">
                        <h4> <!-- This is where the title should be --> </h4>
                    </div>
                    <div class="row">
                        <ul class="events-carousel events-no-carousel">
                            <!-- Item blog post -->
                            <li class="col-xs-6 col-sm-6 col-md-4">
                                <div class="info-post">
                                    <h4><a href="vacancy.twig">Vacature naam</a></h4>
                                    <p><!-- This is where the text should be -->
                                        <a class="btn btn-primary pull-right" href="{{ path('static_page', {template:'club/vacancy'}) }}">Bekijken</a></p>
                                </div>
                            </li>
                            <!-- End Item blog post -->
                        </ul>
                        <!-- End blog post-->
                    </div>
                </div>
                <!-- End Experts -->
            </div>
        </div>
    </div>
    <!-- End Testimonials -->
    <!-- End Section Area - Content Central -->

通常,您应该将表单数据存储在数据库中,然后从数据库中检索它以在另一页上呈现。

因此,带有表单的

页面上的PHP脚本应该保存表单数据,而页面上要显示数据的其他脚本应该从数据库中获取数据。