chadderbox
Technical User
Hello All,
I am working on retrieving and parsing some data from an API. I can get the data in and function it to an array. I can then display the data in a form. However, when I go to process from the form I am only returning the last array function instead of the desired response. Any ideas?
Here is the section, I am having troubles with.
** Note the information comes in from the API in a less than desirable format so I have to clean that before posting to my forms.
$info = array();
$byline = explode("\n", $data);
foreach ($byline as $i=> $value) {
if ($value !=""){
$info[] = $value ;
} }
if ($info !=""){
$number = array();
foreach ($info as $newdata){
$row = explode(",", $newdata);
$number[] = $row[0];
}
echo "<table style='border' cellspacing=0 cellpading=1>
<form method=POST action=numberfinal.php name = Number>
<input type=hidden name=CUST value=$CUST>
<tr><td width= 150 align=center><input readonly name=number value=$number[0]></td><td width=150 align=center>$rate</td><td>$CUST</td> <td><input type=submit value=Order name=Order></td></select>
</tr>
<tr><td width= 150 align=center><input readonly name=number value=$number[1]></td><td width=150 align=center>$rate</td><td>$CUST</td> <td><input type=submit value=Order name=Order></td></select>
</tr>
<tr><td width= 150 align=center><input readonly name=number value=$number[2]></td><td width=150 align=center>$rate</td><td>$CUST</td> <td><input type=submit value=Order name=Order></td></select>
</tr>
<tr><td width= 150 align=center><input readonly name=number value=$number[3]></td><td width=150 align=center>$rate</td><td>$CUST</td> <td><input type=submit value=Order name=Order></td></select>
</tr>
</table>";
I am working on retrieving and parsing some data from an API. I can get the data in and function it to an array. I can then display the data in a form. However, when I go to process from the form I am only returning the last array function instead of the desired response. Any ideas?
Here is the section, I am having troubles with.
** Note the information comes in from the API in a less than desirable format so I have to clean that before posting to my forms.
$info = array();
$byline = explode("\n", $data);
foreach ($byline as $i=> $value) {
if ($value !=""){
$info[] = $value ;
} }
if ($info !=""){
$number = array();
foreach ($info as $newdata){
$row = explode(",", $newdata);
$number[] = $row[0];
}
echo "<table style='border' cellspacing=0 cellpading=1>
<form method=POST action=numberfinal.php name = Number>
<input type=hidden name=CUST value=$CUST>
<tr><td width= 150 align=center><input readonly name=number value=$number[0]></td><td width=150 align=center>$rate</td><td>$CUST</td> <td><input type=submit value=Order name=Order></td></select>
</tr>
<tr><td width= 150 align=center><input readonly name=number value=$number[1]></td><td width=150 align=center>$rate</td><td>$CUST</td> <td><input type=submit value=Order name=Order></td></select>
</tr>
<tr><td width= 150 align=center><input readonly name=number value=$number[2]></td><td width=150 align=center>$rate</td><td>$CUST</td> <td><input type=submit value=Order name=Order></td></select>
</tr>
<tr><td width= 150 align=center><input readonly name=number value=$number[3]></td><td width=150 align=center>$rate</td><td>$CUST</td> <td><input type=submit value=Order name=Order></td></select>
</tr>
</table>";