0
Store values in a variable by GET
Example:
$id = $_GET['id'];
$dados = array($id);
Doubt:
How to save all Ids? Because I will use these Ids to identify which product was selected.
I created a shopping cart using SESSION, when clicking on the product, it records in Sesssion its data, but when clicking on the product, I am checking if the value of the product is greater than the credit that the user has, if it is bigger then it goes to page to finalize the purchase, otherwise, it goes back to the product page, but will appear to the user the products he has selected, ie, I put a VISA icon on top of the product. But to put this icon, I’m checking to see if the $_SESSION['idProduct'] is equal to the product id
Save in session and then rescue.
– João Mello
John, can you give an example?
– user3081
$id = $_GET['id']; $id2 = $_GET['id2']; $id3 = $_GET['id3']; $id4 = $_GET['id4']; $data = new Array($id, $id2, $id3, $id4) Your code is similar to this one?
– Samir Braga
@Samirbraga I created a shopping cart using SESSION, by clicking on the product, it records its data to Session, but by clicking on the product, I’m checking to see if the value of the product is greater than the credit the user has, if it is bigger then it goes to page to finalize the purchase, otherwise it goes back to the products page, but will appear to the user the products he selected, IE, I put a VISA icon on top of the product. But to put this icon, I’m checking to see if the $_SESSION['idProduct'] is equal to the product id.
– user3081