我想获得下面显示的html表单的数组的值,并使用php进行显示。但我的代码似乎有问题。
请协助。如何从HTML数组获取textarea的值
HTML阵列
<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>
我的PHP代码
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;
}
}
问题*“头文件已发送”*? – adeneo
不会做任何事情只是重新加载 – dannjoroge
你在期待什么,表单是否具有'action'属性,或者你认为'header'调用在你回显输出后会实际重定向? – adeneo