Error Warning: include PHP

0

Do you know what could be the cause of the error?

myroutecode:

<?phpclassRotas{private$telaAtual="primeira";

public function getTelaAtual() {
    return $this->telaAtual;
}
public function setTelaAtual($value) {
    return $this->telaAtual = $value;
}
public function verifyRoutes() {
if($this->getTelaAtual() == "primeira"){
    include "../backend/components/firstpage.php";
}

}
}

my code on page "juego.php":

    
asked by anonymous 13.10.2018 / 04:26

1 answer

0

Using ../ , you are trying to give include() to a folder prior to the game.php, to give include in a file from the root directory of your project you use ./ or if you wanted to give a include from the current file does not require ./ and nor ../ , just the directory.

Try these two alternatives:

1. Alternative (from project root)

include "./backend/components/firstpage.php";

2. Alternative (file directory only)

include "backend/components/firstpage.php";
    
13.10.2018 / 06:09