I am trying to get the value of the array of a html form shown below and display using php. But my code seems to have an issue.
Please assist.
html array
<textarea rows="1" maxlenth = "20" class="round" id="quantityid[]" name="quantityname[]"><?php echo $itemsale["quantity"]; ?></textarea>
<td align="center"><?php echo '<span class="remove-itm"><a href="add_sales.php?saveep='.$itemsale["productname"].'&return_url='.'add_sales.php'.'"><img src="images/saveicon.png" width="30" height="30" /></a></span>'; ?></td>
<textarea rows="1" maxlenth = "20" class="round" id="quantityid[]" name="quantityname[]"><?php echo $itemsale["quantity"]; ?></textarea>
<td align="center"><?php echo '<span class="remove-itm"><a href="add_sales.php?saveep='.$itemsale["productname"].'&return_url='.'add_sales.php'.'"><img src="images/saveicon.png" width="30" height="30" /></a></span>'; ?></td>
<textarea rows="1" maxlenth = "20" class="round" id="quantityid[]" name="quantityname[]"><?php echo $itemsale["quantity"]; ?></textarea>
<td align="center"><?php echo '<span class="remove-itm"><a href="add_sales.php?saveep='.$itemsale["productname"].'&return_url='.'add_sales.php'.'"><img src="images/saveicon.png" width="30" height="30" /></a></span>'; ?></td>
my php code
if(isset($_GET["saveep"]) && isset($_GET["return_url"]) && isset($_SESSION["cart_sales"]))
{
$product_code = $_GET["saveep"]; //get the product code to remove
$return_url = base64_decode($_GET["return_url"]); //get return url
foreach( $_POST['quantityname'] as $v ) {
echo $v;
}
}