Search within a _POST

0

I was wondering if I can fetch data within a POST? I need a lot, because each box is a different id. Example:

    **JS:** 
data {'id':id, 'ponto1':ponto1}
    **AJAX:**
id: $id = isset($_GET['id']);
$ponto = isset($_POST['ponto".$id."']);
    
asked by anonymous 04.03.2017 / 01:54

1 answer

1

What you can do is to do this (I'll show you the input in HTML to understand)

Since every dot has an id you can do it like this:

create a hidden field:

<input type="hidden" name="id[]" value="Aqui colocas o teu id"/>

<input type="text" name="post[ID Aqui tm]" />

In php handles like this:

$ArrayComId = $_POST['id[]'];

$ArrayComPost = $_POST['Post[]'];

Then just make a foreach and get the post of each ID

foreach($arraycomid as $key => $value)
{
  echo $arraycompost[$value];
}

It is possible to have some error but the logic is +/- this

    
04.03.2017 / 04:30