Include in file with include

0

I have a file that makes an include of a file, which is in a different folder, which in turn makes another include of another file that is also in a different folder.

This is the include:

include( "../header.php" );

Afilethatisinsidethe"1998" folder does include header.php that is in the parent folder and header.php it does include the connection.php, modal.php and page_verify.php which are in the actions folder, but the following errors are issued:

  

Warning: include_once (../ actions / connection.php): failed to open stream: No   such file or directory in   C: \ xampp \ htdocs \ PMI-WEB-CONTAB-ALPHA \ pages \ header.php on line 5

     

Warning: include_once (): Failed opening '../acoes/conexao.php' for   inclusion (include_path = 'C: \ Xampp \ php \ PEAR') in   C: \ xampp \ htdocs \ PMI-WEB-CONTAB-ALPHA \ pages \ header.php on line 5

     

Warning: include_once (../ actions / modal.php): failed to open stream: No   such file or directory in   C: \ xampp \ htdocs \ PMI-WEB-CONTAB-ALPHA \ pages \ header.php on line 6

     

Warning: include_once (): Failed opening '../acoes/modal.php' for   inclusion (include_path = 'C: \ Xampp \ php \ PEAR') in   C: \ xampp \ htdocs \ PMI-WEB-CONTAB-ALPHA \ pages \ header.php on line 6

     

Warning: require (../ acoes / pagina_verificar.php): failed to open   stream: No such file or directory in   C: \ xampp \ htdocs \ PMI-WEB-CONTAB-ALPHA \ pages \ header.php on line 11

     

Fatal error: require (): Failed opening required   '../accessories/pagina_verify.php' (include_path = 'C: \ Xampp \ php \ PEAR') in   C: \ xampp \ htdocs \ PMI-WEB-CONTAB-ALPHA \ pages \ header.php on line 11

    
asked by anonymous 15.01.2018 / 17:23

1 answer

1

All so-called includes must have the same relative path as the parent file.

If you made include "../header.php" , all includes within header.php should be include "../../acoes/arquivo.php"

So in your code when you use include "../acoes/pagina_verificar.php" you are trying to access pages / actions / pagina_verify.php instead of actions / pagina_verify.php     

15.01.2018 / 19:52