How to make the link take you to the same page

0

I have a vertical bar, which has several things, but in one it has to say "Products" and when you click it displays and leaves "Register Product" I want that by clicking on "Register Product" a form appears in the white part of the page that I have left, that is, I do not want to tighten it to take me to another page with the form, I want you to stay in the same room, how can you do that?

    
asked by Eduardo Ortiz 21.08.2018 в 23:20
source

2 answers

0

You can pass parameters in the url of your links and show or hide elements with PHP (among several other solutions). But as they say maybe the normal thing would be to use ajax, or JS + CSS.

<ul>
    <li><a href="?mostrar">Mostrar</a></li>
    <li><a href="?registrar">Registrar</a></li>
</ul>

<div>
<p>Producto 1</p>
<p>Producto 2</p>
</div>

<?php if(isset($_GET["registrar"])):?>
    <form>
        <input name="loquesea" value="">
        <input type="sunbmit">
    </form>
<?php endif;?>
    
answered by 22.08.2018 в 00:16
-1

I understand what you need is this ...

<a href="#deseoIr">Ir a la parte Blanca</a>

<div id="deseoIr">
    <p>Aqui es la parte Blanca</p>
</div>

I hope you serve, you tell me!

    
answered by 21.08.2018 в 23:25