Hiding the ID of a URL [duplicate]

0

I have a function that captures the URL ID and does the query in the DB and returns the value on the page, how to do this query without appearing the ID in the URL?

Currently it looks like this:

  

link

How do I hide the ?id=9991 of the URL to look like this:

  

link

I'm leaving the function here, but I think the function itself does not add up to the question.

function protetor() {
    $conexao = mysqli_connect("127.0.0.1","root","","protetor");
    $id = $_GET['id'];
    $dados = mysqli_query($conexao, "SELECT * FROM download WHERE ID = $id");
    $download = mysqli_fetch_array($dados);
    if (!empty($id)) {
        echo $download['link'];
    } else {
        echo "Link de download não encontrado!";
    }
}
    
asked by anonymous 14.12.2018 / 14:19

1 answer

0

Good morning!

You have the option of passing through a POST instead of a GET

ex:

<input type="hidden" ....value="ID" />

You can also share the data by SESSION which is less recommended.

    
14.12.2018 / 14:30