Ok so I have a form that returns words and I want to put those words together in the string $querystring. Then I want to delete the last comma.
[CODE]
while(list($key, $value) = each($HTTP_POST_VARS))
{
if($key == ‘submit2’){}
else
{
$queryselect = $queryselect.$key.”, “;
}
}
//take off the last comma
$length = strlen($queryselect);
$queryselect[$length-2]=” “;
echo $queryselect;
echoing $queryselect should return a long string of words for instance:
Hi, my, name, is
This all works fine and dandy..After this is done the program does this
[CODE]
echo ”
<table>
<form name = ‘IR_SELECT’ action = $PHP_SELF method = ‘get’>”;
while($row = pg_fetch_row($result))
{
if($count%4==0)
{
echo”<tr>”;
}
echo”<td><input type=checkbox name = $row[1]>$row[0]<br></td>”;
$count++;
}
echo”
<tr>
<input type = ‘hidden’ name = ‘queryselect’ value = $queryselect>
<td><input type=’submit’ value=’submit’ name =’submit’></td>
</tr>
</form>
</table>”;
As soon as I hit submit something happens to the string $queryselect. When I echo it out it only returns ‘Hi’. I think it turns it into an array. Why is it doing this?