It is necessary to transfer to the server table values in four columns. the number of lines is not known in advance; all lines have different id, but inside each standard name. How is all this miracle better to transfer to the server?
<tbody id="ntbody"> <tr id="0"> <td>Цвет<select name="color" id=""> <option value=""></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select></td> <td>Размер<select name="size" id=""> <option value=""></option> <option value="1">1jgwbz</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select></td> <td>Артикул<input type="text" name="art"></td> <td>Количество<input type="text" name="count" style="width:50px;" value="0"></td> </tr> </tbody>
From all this, I would like to get on the server a type
Array ( [0] => Array ( [color] => 1 [size] => xl [art] => 123 [count] => 10 ) [1] => Array ( [color] => 1 [size] => xl [art] => 123 [count] => 10 ) [2] => Array ( [color] => 1 [size] => xl [art] => 123 [count] => 10 ) [3] => Array ( [color] => 1 [size] => xl [art] => 123 [count] => 10 ) )
tried jquery:
$.ajax({url: 'echo.php', data:$('#ntbody select, #ntbody input', success: alert(html))});
In echo.php:
<?php print_r($_GET);?>
But this is the first line (((
What do you advise to do?
explod
, it already lies in the $ _GET array (and should be in $ _POST). - etki