Post system

-1

I think the title n was very clear but I will explain right here what I need and I am not getting good results.

Well what I'm trying to do is the following.

In the link on my page it stays that way - > "www.site.com/Teste?cadastro=1"

This value "1" is the ID, so that's fine, but what I wanted is another field in my database, such as the Code field.

Making this link look like this - > "www.site.com/Teste?cadastro=A1g667100B"

This is my code.

<?php
    $Pagina = (isset($_GET['Codigo'])) ? $_GET['Codigo'] : 1;
    $BancoD = "SELECT * FROM cadastro ORDER BY id ASC";

    $Val = mysqli_query($conexao,$BancoD);
    $Total = mysqli_num_rows($Val);
    $Quantidade = 1;
    $NumeroPagina = ceil($Total/$Quantidade);
    $PaginaInicial = ($Quantidade*$Pagina)-$Quantidade;

    $Bancod = "SELECT * FROM cadastro ORDER BY id ASC LIMIT $PaginaInicial,$Quantidade";
    $Val= mysqli_query($conexao,$BancoD);
    $Total = mysqli_num_rows($Val);

    while ($NovelPost = mysqli_fetch_array($Val)){
        echo $NovelPost['Nome'];
        echo $NovelPost['Idade'];
        echo $NovelPost['Cidade'];
        echo $NovelPost['Codigo'];              
    }
?>
    
asked by anonymous 08.12.2017 / 17:00

1 answer

0

In this case you will do so:

www.site.com/Teste?cadastro=1&codigo=A1g667100B

But I suggest you start learning the post method too, if this is a secret. If it is not, you can pick up via GET without problem. Very careful with information in GET.

    
08.12.2017 / 17:06