Can anyone help me with the GET function?

0

To make a shopping site, hence has the products table and the order table, where after the person buys something writes in the table orders, but wanted to write the product id in the table orders, how to do this by GET, is it already getting the id by GET to appear in the cart?

    
asked by anonymous 06.11.2015 / 18:15

1 answer

0

Visit the PHP documentation:

PHP: $ _GET - Manual

As for it already being catching the ID by GET, if I understood correctly, you can use another variable to pass other values, separating them by the character & . GET retrieves values through the page URL:

http://www.pagina.com.br/index.php?id=1&outra_variavel=valor

When loading this page, to capture the value of the parameters "id" and "variable_variable", use:

$idProduto = $_GET['id'];
$outroValor = $_GET['outra_variavel'];

NOTE: If you are dealing with sensitive data such as a password, use the POST method and, if necessary, encryption (md5).

I do not know if it helps, what your level of knowledge, or where it's in the project, so that's what I can do right now. Good Luck!

    
07.11.2015 / 03:34