有人可以帮我解决这个问题,因为我真的要疯了!
我有追随者;
.........Some code and then
,
<?php
if(isset($_POST['sendone']))
{ if(!isset($_POST['delz']))
{echo 'No check boxes are selected!'; return;} else
{
$mohan = "<table border='1' cellspacing='0' cellpadding='1' id='brQndTab' class='brndTa'>";
foreach($_POST['delz'] as $delz)
{
$delz=mysqli_real_escape_string($db,$delz);
$QR = "SELECT bname, bvariant, bsku FROM brands WHERE id='$delz'";
$rr = mysqli_query($db,$QR) or die ("SQL Error");
$roV = mysqli_num_rows($rr);
$rr = $rr->fetch_assoc();
$mohan .= "<tr class='sc_eght' ><td class='sc_five'>".$rr['bname']." ".$rr['bvariant']." ".$rr['bsku'];
$mohan .="</td>
<td><textarea style='width:80px;' name='schema[]' id='vtext' class='sc_one' rows='1' cols='1' maxlength='100'></textarea></td>
<td><input style='width:80px;' type='text' name='allocas[]' id='vtext' class='sc_two' size='80' maxlength='5'></td>
<td><input style='width:80px;' type='text' name='channelz[]' id='vtext' class='sc_three' size='120' maxlength='30'></td>
<td><input style='width:80px;' type='text' name='provinz[]' id='vtext' class='sc_four' size='120' maxlength='30'></td>
</tr>";
}
$mohan .= "<form method='post' action=''><input type='submit' name='sendMe' id='sendMe' value='Save'></form></table>";
$_SESSION['cb'] = $mohan; }
if(isset($_SESSION['cb']))
echo $_SESSION['cb'];
}
if(isset($_POST['sendMe']))
{
if($_POST['provinz'] == '')
{echo $_SESSION['cb']; echo "Province is empty!"; return;} else { echo $_SESSION['cb']; echo "Saved!"; return;}
if($_POST['allocas'] == '')
{echo $_SESSION['cb']; echo "Allocation is empty!"; return;} else { echo $_SESSION['cb']; echo "Saved!"; return;}
}
?>
…………
问题是何时sendMe
提交;
- 给我和错误
Notice: Undefined index: provinz in C:\xampp\htdocs\docs\add_invoice\testmm.php on line 104
- 即使我尝试通过
if(isset($_POST['sendMe']))
似乎不是正确的方法来获取动态表文本框的值。任何建议都会很棒。
有人可以在这两件事上帮助我吗?如果我的问题不清楚,请发表评论,以便我尽我所能淡化歧义。谢谢