Warning error: include PHP

Asked

Viewed 38 times

0

You know what could be the cause of the error? inserir a descrição da imagem aqui

my route code:

<?php
class Rotas {
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 page code "game.php": inserir a descrição da imagem aqui inserir a descrição da imagem aqui

1 answer

0

Using ../, you’re trying to give include() in a folder previous 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 doesn’t even need to ./ nor ../, just the directory.

Try these two alternatives:

1. Alternative (from the root of the project)

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

2. Alternative (file directory only)

include "backend/components/firstpage.php";

Browser other questions tagged

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