Help With Layout And Select Maintain State

I have the following html structure (very simple).

<div id="header">


    	<input name="search" type="text" id="search" />


          <option>Select Category</option>

          <?php foreach($category as $c): ?>

          	<option value="<?php echo $c->id; ?>"><?php echo $c->name; ?></option>

          <?php endforeach; ?>




<div id="main">

	<?php echo $content; ?>


<div id="footer">

	// ////////////


An image to illustrate

I have two questions

1st -> no action site/index I send the content is displayed in: <? Php echo $ content;?> Then how do I get the contents of the categories for <? Php foreach ($ category the $ c):?>

2st -> How do I maintain the state of the select category when a user does a search?