Good afternoon to everyone!
I tell you my problem: I have a file in which I can publish an announcement, but first I must make an include to the configuration file, where the connection variables and others are located. The fact is that by trying and testing I am not able to do the include. The files are uploaded to a school server, then I will leave the file structure and see how I can get the include. Thank you very much in advance!
//comprobamos si la extension actual es una de las disponibles en el array $allowed
if (in_array($fileActualExt, $allowed)) {
//comprobamos que no hay ningun error
if ($fileError === 0) {
//comprobamos el tamaño del archivo (kb)
if ($fileSize < 10000000) {
/*$rootPath = $_SERVER['DOCUMENT_ROOT'];
echo "esta es la ruta " . $rootPath;
echo $rootPath . '/config/dbh.inc.php';
include_once($rootPath . '/config/dbh.inc.php');*/
include_once('../config/dbh.inc.php');
//nuevo nombre aleatorio para que nunca se repitan
$fileNameNew = uniqid('', true).".".$fileActualExt;
$fileDestination = $rootPath . 'uploads/'. $fileNameNew;
As you can see, the problem comes in the include_once('../config/dbh.inc.php);
found in the file componentes/uploadAd/model.php
And here the structure of the project: