Menu in PHP and HTML [closed]

1

I need you to ask me a question, I created a page and put the menu in PHP. Following data:

menu.php

<div class="col-md-9 text-left float-left collapse-navation">
    <div class="navbar-collapse collapse navbar-inverse no-transition">
        <ul class="nav navbar-nav navbar-left">
            <li><a href="../index.html">Home</a></li>
            <li><a href="../#sobre">Sobre</a></li>
            <li><a href="../#work">Destaques</a></li>
            <li><a href="../#titulos">Títulos</a></li>
            <li><a href="../#testimonial">Testemunho</a></li>
            <li class="last"><a href="../#contato">Contato</a></li>
        </ul>
    </div>
</div>

And I put another include.php page:

<?php
include ('../menu.php');
?>

But when the menu comes into the page the links created do not work when you click on them, only working if you right-click and open in a new tab. What can it be? The problem is just that, the links.

My server is from Locaweb.

    
asked by anonymous 09.10.2015 / 16:48

2 answers

1

This type of links will only work on the page itself, or with the execution of javascript.

As the code is, I check that it is returning to another one.

    
09.10.2015 / 18:06
0

When you use #ocorrencia in the URL, it means that you are pointing to an anchored place on your page.

It will go through until you find the occurrence on the same page <a name="ocorrencia" id="ocorrencia"></a> , and in this case it makes no sense you to put "../" address mapping before that, as it will be ignored by the anchor, because when clicking you will not change your page, nor with "pray brava". An example of using a link (#) that would change the page is by creating routes using Angular JS, but from there already ajax technology enters the middle, which does not have much to do with what you are apparently .

    
09.10.2015 / 18:58