How to take data through the GET method?

0

I am setting up a financial control panel for a MEI company (This company is mine). I'm developing the part of the requests, doubt follows:

The issue is that I already use this GET to fetch the pages, how could I add that link to take the order ID to show in the other field?

Link Example:

<a href="index.php?Pagina=pag&filtro=pedido">Pedidos de Vendas</a>

This code is in index to get the link:

<?php
    if(isset($_GET['Pagina']))
    {
        $pagina =($_GET['Pagina']);
        if(file_exists('arquivos/'.$pagina.'.php'))
        {
            @include_once("arquivos/$pagina.php");
        }
        else
        {
            @include_once("arquivos/404.php");
        }
    }
    else
    {
        if(file_exists('arquivos/home.php'))
        {
            @include_once("arquivos/home.php");
        }
        else
        {
            @include_once("arquivos/404.php");
        }
    }
?>

    
asked by anonymous 30.10.2016 / 22:48

1 answer

0

Your question was not very clear, but if that's what I understand, you want to add the ID of an order or product when you click on a link.

I think you already have an example of this in your own system, in the TASKS column each edit / delete link does just that.

Maybe you want to pass more than one parameter to a page through GET, if that's the rule it's like this:

  • For passing the first parameter (variable) use? (query) as a separator;
  • If there are more parameters (variables) that you want to pass to the page use & (and commercial) as a separator;

Example:

<a href="index.php?Pagina=pag&filtro=pedido&idProduto=<?php echo $idProduto ?>">Pedidos de Vendas</a>

Make your question clearer ...

A hug.

    
31.10.2016 / 13:00