Question: ```
I have a table with: 
 tbl_Category
  Id        |           Name            |       ParentID

  1                 Category 1                      0
  2                 Category 2                      0
  3                 Subcategory 11                  1
  4                 Subcategory 12                  1
  5                 Subcategory 21                  2
  6                 Subcategory 211                 5
  7                 Subcategory 22                  2
.........

How do I return it in a dropdownlist in the below format:

Category 1
--Subcategory 11
--Subcategory 12
--Subcatgory 13
Category 2
--Subcategory 21
----Subcategory 211
----Subcategory 212
--Subcategory 22
--Subcatgory 23
Category 3
--Subcategory 31
--Subcategory 32

```

Answer: 
HTTP is stateless. `$_POST` array is populated when a user makes a request. If you want to have access to a value accross web views, read on [setcookie](http://php.net/manual/en/function.setcookie.php) or [sessions](http://php.net/manual/en/features.sessions.php). 

If you don't want to use cookies, you'll need to resend your parameters on every request (probably obscured some way). Or send an identifier on every request an keep your info server (you can do that with php sessions anyway). But doing that is not convenient nor secure.
You can use **session**. base on your code you can try this:
In start page (ddd.php) you have to set your session values.

```
<?php
  session_start();
  $_SESSION["writer"] = $_POST["writter"];
?>
...

```

in other page use your session values as e.g:

```
<?php
  session_start();
  ...
  echo $_SESSION["writer"];
?>

```

Note that **unset** and **destroy** your session at the end off your work.

```
<?php
    // remove all session variables
    session_unset();

    // destroy the session
    session_destroy(); 
?>

```