include does not work

Asked

Viewed 86 times

0

I made a modular system in which each part of the pages is in a folder, the problem is that I have a page with a form that is inside a modal, that form receives information from the bank, when I just run the form it works correctly and when I run the modal page it also works, but when I run the entire page with get the error in include

Warning: include(../form/formCriar.php): failed to open stream: No such file or directory in C: wamp www CRUD modal modalCriar.php on line 11.

Page structure

inserir a descrição da imagem aqui

Page on which the error is generated

<!-- Modal -->
<div id="criar" class="modal modal-fixed-footer">
    <div class="modal-content" style="overflow-x: hidden;">
        <div class="row">
            <div class="col s12">
                <h4></h4>
                <p class="grey-text">

                </p>
            </div>
            <?php  include("../form/formCriar.php");  ?>
            <p class="Falha red-text center"></p>
        </div>
    </div>
    <div class="modal-footer">
        <a href="#!" class="modal-close btn-flat">Cancelar</a>
        <button class="btn cyan" type="submit" form="formCriar">Criar</button>
    </div>
</div>
<!-- Fim Modal-->
  • The problem is probably that you use the relative path, try include dirname(__FILE__)."../form/formCriar.php";

  • I tried that and unfortunately it didn’t work :/

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.