Fatal error in a PHP include

0

In php I have this folder 'architecture': (lo que esta en negritas son las carpetas y lo que no los archivos).
NOTE: The shared folder NO is inside the Curriculum.
Students

  • Curriculum
  • informacion_estudiantes.php
  • Shared
  • navs.php


In the file informacion_estudiantes.php everything is in html but with extension php by which if I go to do a include I must do this <?php include... ?>

THE PROBLEM:
I throw a warning "Failed opening '../Compartido/navs.php' for inclusion (include_path='C:\xampp\php\PEAR')" when I try to do the include to the file navs.php from my file informacion_estudiantes.php ... this is what I do <?php include("../Compartido/navs.php") ?> ... I hope to have made me understand and what would be the correct way .. I have tried several ways and it does not work for me.

    
asked by JDavid 27.01.2017 в 15:24
source

3 answers

1

If you still have not solved the problem, try the following

require_once(APPPATH.'Estudiantes/Compartido/navs.php');

to return to your parent directory Students and then access the folder where your script is located

I hope you serve friend ..

greetings

    
answered by 27.01.2017 / 17:10
source
3

You must put it in the following way:

include('./Compartido/navs.php') ?>

You have a . left since with .. you are referring to the parent folder.

    
answered by 27.01.2017 в 15:35
1

If the cnbandicoot did not work for you, you could try creating an absolta url

<?php
$path = $_SERVER['SERVER_NAME'];
include($path."/Compartido/navs.php") ?>
    
answered by 27.01.2017 в 15:54