-2
I’m creating a PHP to list the files in a folder and added a style to it. I don’t know what’s going wrong, so please help me. On my server page error appears on line 26.
<?php
// diretorio dos pdf's
$dir = "./ebooks";
// ediretorio
$dh = opendir($dir);
// loop que busca todos os arquivos até que não encontre mais nada
while (false !== ($filename = readdir($dh))) {
// verificando se o arquivo é .pdf
if (substr($filename,-4) == ".pdf") {
// mostra o nome e o link do arquivo
echo "<a href=\"$filename\">$filename</a><br>";
?>
<style>
.blue
{
background-color: #33383E;
color: #C7C8C8;
border-bottom: 1px solid #14161A;
}
</style>
}
?>
You never close the while
– bfavaretto
Neither the if. And closes php at the end without having reopened
– bfavaretto
Line 26 is ghost error, because your code only has 25 lines!! What should appear is: syntax error, Unexpected end of file in ..... line 25
– user60252