Can I use $ _GET with $ _SESSION?

0

I have this PHP code working,

<?php
include "../conexao.php";
$codigo = $_POST['codigo'];
$nome_marca = $_POST['nome_marca'];
$query = mysql_query("SELECT * FROM marca order by nome_marca")or die(mysql_error());
while($res = mysql_fetch_array($query)){
?>
<ul>
    <li><a href="prod_index_marca.php?codmarca=<?php echo $res['codigo'];?>"><?php echo $res['nome_marca'];?></a></li>
<?php
}
?>
</ul>      

and directs href to the page according to the code for the selected tag.

And the landing page has this PHP code

<?php
include "../conexao.php";
$codmarca = $_GET['codmarca'];
$query = mysql_query("SELECT * FROM produto WHERE codmarca = '$codmarca'");
while($res = mysql_fetch_array($query)){

$codigo = $_POST['codigo'];
$img01 = $_POST['img01'];
$descricao = $_POST['descricao'];
$titulo = $_POST['titulo'];
$codcategoria = $_POST['codcategoria'];
$codmarca = $_POST['codmarca'];
$preco = $_POST['preco'];
$pagseguro = $_POST['pagseguro'];
$titulo = $_POST['titulo'];
?>

which receives the data via $ _GET.

My question is whether you can adapt these codes to work with $ _SESSION?

And if you have, friends can guide me how to convert them, or even where I can get information on the subject.

From now on, my thanks go to everyone, for the attention to my doubt.

    
asked by anonymous 03.10.2016 / 22:38

1 answer

0

I assume you already know how a session works.

Then you will practically trade your $ _ POST with $ _ SESSION

03.10.2016 / 23:42