Note that there are some explanatory texts on larger screens.

plurals
  1. POValidating a dynamically populated table content in PHP
    primarykey
    data
    text
    <p>Can some one help me on this as I'm really going nuts!</p> <p>I've got following;</p> <p><code>.........Some code and then</code>,</p> <pre><code> &lt;?php if(isset($_POST['sendone'])) { if(!isset($_POST['delz'])) {echo 'No check boxes are selected!'; return;} else { $mohan = "&lt;table border='1' cellspacing='0' cellpadding='1' id='brQndTab' class='brndTa'&gt;"; 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-&gt;fetch_assoc(); $mohan .= "&lt;tr class='sc_eght' &gt;&lt;td class='sc_five'&gt;".$rr['bname']." ".$rr['bvariant']." ".$rr['bsku']; $mohan .="&lt;/td&gt; &lt;td&gt;&lt;textarea style='width:80px;' name='schema[]' id='vtext' class='sc_one' rows='1' cols='1' maxlength='100'&gt;&lt;/textarea&gt;&lt;/td&gt; &lt;td&gt;&lt;input style='width:80px;' type='text' name='allocas[]' id='vtext' class='sc_two' size='80' maxlength='5'&gt;&lt;/td&gt; &lt;td&gt;&lt;input style='width:80px;' type='text' name='channelz[]' id='vtext' class='sc_three' size='120' maxlength='30'&gt;&lt;/td&gt; &lt;td&gt;&lt;input style='width:80px;' type='text' name='provinz[]' id='vtext' class='sc_four' size='120' maxlength='30'&gt;&lt;/td&gt; &lt;/tr&gt;"; } $mohan .= "&lt;form method='post' action=''&gt;&lt;input type='submit' name='sendMe' id='sendMe' value='Save'&gt;&lt;/form&gt;&lt;/table&gt;"; $_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;} } ?&gt; </code></pre> <p>..........</p> <p>The problem is when <code>sendMe</code> is submitted;</p> <ol> <li>Gives me and error <code>Notice: Undefined index: provinz in C:\xampp\htdocs\docs\add_invoice\testmm.php on line 104 </code></li> <li>Even though I try to get the values of the dynamic table textboxes via <code>if(isset($_POST['sendMe']))</code> doesnt appear to be a right method of doing that. Any suggestions would be great. </li> </ol> <p>Can some one help me on this two things? In case if my problem is not clear please comment so I shall do my best to dilute the ambiguity. Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload