# Question about $\_POST

**URL:** <https://forum.kirupa.com/t/question-about--post/264046>\
**Category:** programming\
**Created:** [June 22, 2008, 5:07pm UTC](https://forum.kirupa.com/t/question-about--post/264046 "2008-06-22T17:07:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamerp](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@dreamerp](https://forum.kirupa.com/u/dreamerp)\
**Post date:** [June 22, 2008, 5:07pm UTC](https://forum.kirupa.com/t/question-about--post/264046/1 "2008-06-22T17:07:13Z")

</div>

Hello,

I am just trying to make a simple automated way of organizing some products in a database. Basically, I echoed all of the products and with each one I have a dropdown menu I can select a category. Then, I have all of these dropdowns in one form so I can submit all at one time.

To distinguish each dropdown, I have their names set as category.$productid so basically each dropdown is identified by the $productid.

Then, once the user submits this form, for each result in the database I find the $\_POST[“category.$productid”]; . However, it cannot get these values. So, I tried using one variable in the $\_POST but it still does not work. Is it not possible to place variables in $\_POST? Here is the PHP for processing this-

```php
$a = $_GET["a"];
if ($a == "go"){
$selectall = mysql_query("SELECT * FROM products ORDER BY productid DESC");
while ($row = mysql_fetch_array($selectall)){
$productid = $row["productid"];
$categorytxt = "category.";
$categoryid = $categorytxt.$productid;
$categoryvalue = $_POST["$categoryid"];
echo "CategoryID: $categoryid<br>Cat Value: ".$_POST["$categoryid"]."<br><br><br>";
}
} 

```

This echos $categoryid but NOT $\_POST[“categoryid”];

I have tried echoing $categoryvalue because it is the same as $\_POST["$categoryid"]; but this did not work either.

Can someone please help?

Thanks

---

<div class="post-metadata">

**Author:** ![dreamerp](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@dreamerp](https://forum.kirupa.com/u/dreamerp)\
**Post date:** [June 23, 2008, 1:40am UTC](https://forum.kirupa.com/t/question-about--post/264046/2 "2008-06-23T01:40:05Z")

</div>

Found solution. You can just use an identifier after the $\_POST like $\_POST[“category”][$id] and the form that you are submitting you add the identifier to the field. So, if you have an text input, just use name=“category[$id]”
