I'm new to programming in PHP, I created a dynamic site using the following code:
<nav>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="?pag=home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="?pag=contato">Contato</a>
</li>
</ul>
</nav>
<?php
$paginas = @$_GET['pag'];
switch ($paginas) {
default :
include 'home.php';
break;
case 'home':
include 'home.php';
break;
case 'contato':
include 'contato.php';
break;
}
?>
<footer>
</footer>
The navigation bar and footer are fixed, having the PHP "switch" exchanging the central content.
To request the exchange of content I use the following link:
<li class="nav-item">
<a class="nav-link" href="?pag=contato">Contato</a>
</li>
My URL looks like this: link . But I'd like it to look like this: link .
However, I have tried everything I know about PHP to find a solution, but I can not solve it, please help me.