html - unable to get id from URL php

I want to get the id when pressing a button in order to delete an item from a session. The id appears in the URL but i'm not able to get it using $_GET.
<form action="Shop.php?id= <?php echo $values["ProductCode"]; ?>" method= "post">
<input type= "submit" name="remove" value= "Remove" class= "btn btn-danger">
</form>
if(isset($_POST['remove'])){
foreach($_SESSION["shopping_cart"] as $keys => $values){
if($values["ProductCode"] == $_GET['id']){
unset($_SESSION["shopping_cart"][$keys]);
echo '<script>alert("Item Removed")</script>';
echo '<script>window.location="Shop.php"</script>';
Answer
Solution:
Remove the space betweenid=
and<?php echo $values["ProductCode"];?>
<form action='Shop.php?id=<?php echo $values["ProductCode"];?>' method='post'>
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: too few arguments to function laravel
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.