0
I’m trying to run a php file inside html,I get the file myself but when I call by include_once() in html the page just doesn’t load.
HTML
<div class="input-field col s4 m3">
<select name="estado" id="id_estados" class="browser-default" >
<option value="" selected="selected">Escolha o estado:</option>
<?php include_once("../CRUD/Chamadas/listarEstados.php"); ?>
</select>
</div>
PHP
<?php
include_once("../DAO/dalLocalizacao.php");
$dalLocalizacao = new dalLocalizacao();
$estados = $dalLocalizacao->listarEstado();
while($estado = mysqli_fetch_array($estados))
{
$item = $estado['Nome'];
$uf = $estado['Uf'];
$item = utf8_encode($item);
echo '<option value="'.$uf.'">'.$item.'</option>';
}
?>
PHP2
<?php
include_once("../Classes/classLocalizacao.php");
include_once("../Classes/classConexao.php");
public function listarEstado()
{
$query = "SELECT * FROM Estado";
$estados = $this->conexao->query($query) or die(mysql_error());
return $estados;
}
?>
Folder structure
Go to the page and paste the last lines of the PHP error log to us. Great chance of being a path error (or even syntax error). Almost always the PHP log has the solution for this type of problem.
– Bacco
sorry the question the result of the browser console you speak ?
– Reignomo
Error logging. is one of the first things that anyone who uses PHP should know, is where all the errors are recorded. Usually, when it is used with apache, it is in the same file. It depends on who set up the server.
– Bacco
Just to be sure, you’re accessing the files through a PHP server, right?
– Costamilam
By the structure shown in the figure, the path in the
PHP
seems to be correct; form in folderform
with../DAO
comes out of the folderform
and enter the folderDAO
. In PHP2 there are no elements to verify.– user60252