0
I am new to PHP programming, I created a dynamic website 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, with the PHP "switches" replacing the central content.
To request the exchange of content use the following link:
<li class="nav-item">
<a class="nav-link" href="?pag=contato">Contato</a>
</li>
My URL looks like this: http://www.meusite.com.br/? pag=cotato. But I wish she’d stay that way: http://www.meusite.com.br/contato.
However, I’ve tried everything I know about PHP to find a solution, but I can’t fix it, please help me.
Welcome Marcos, edit your question and put the code, not the image, facilitates the staff help you
– Pedro Augusto
Thanks for the tip Pedro, I already made the change
– marcos vinícius mesquita