I'm already warning that I'm not with any problem and, alias, I just solved one that refers to this question but anyway, I wanted to know (out of curiosity) why a php script does not run if I open the file through the computer , but if I enter the host address it normally runs?
<html>
<head>
<META CHARSET="UTF-8">
<META NAME="author" VALUE="Fernando Aguiar Pinedo">
<LINK REL="stylesheet" HREF="css.css">
<LINK REL="shortcut icon" HREF="favicon.ico">
</head>
<body>
<div id="cabeçalho">
<h1>Music Downloader</h1>
<p>Download Your Music Here</p>
</div>
<div id="filterlist">
<ul>
<h1 style="font-family:calibri; margin:5px; text-align:center;">Genre</h1>
<li>Rock</li>
<li>Eletronic</li>
<li>Pop</li>
<li>Reggae</li>
<li>Hip Hop</li>
<li>Anime</li>
<li>Video Game</li>
</ul>
<ul>
<h1 style="font-family:calibri; margin:5px; text-align:center;">Language</h1>
<li>English</li>
<li>Japanese</li>
<li>French</li>
<li>Brazilian</li>
<li>Chinese</li>
<li>German</li>
<li>Spanish</li>
</ul>
</div>
<div id="content"> <!--Conteúdo Aqui-->
<?php
include ("connectsql.php");
$consulta = "SELECT * FROM songs";
$result = mysqli_query($link, $consulta) or die(mysqli_error());
if($result){
while($row = mysqli_fetch_array($result)){
$name = $row['Song'];
?>
<p><?php echo "$name"; ?></p>
<?php
}
}
?>
</div>
<!--Até Aqui-->
</body>
</html>
In the "content" div, php does not run directly from the computer, only if it is opened by the internet by typing the localhost address.