how to transfer textboxt value between 2 cases in switch
<p>every one , I face small problem I hope any one help me .
It is e-shopping site , I just want little help. 
the idea after pressing Add to cart link it will transfare him to cart page, there is two link edit and remove , the remove will remove the item , and that is working .
but when some one press edit link , textbox in the quantity column will appear ans save link will appear also once he press save , there will be update in the databse </p>

<p>The problem is : 1- how to transfer textbox value from case "showupdate" to another case "savee"?
I 've tried to <code>$qq=$_POST['qun'];</code> and send the variable in the link of save beside the action and id but it doesnot work always it said undefined variable 'qun'</p>

<p>The second problem is : the textbox and save link appears in all items on the cart , i do not want that , I want just that item who i press edit beside it , to change to textbox and save link will apper.</p>

<p>i know that i 've put while loop , that is just to make sure that the id of item got it when press link edit only who will get textbox and save link </p>

<p>here is the code please please help me, </p>

<pre><code>switch($action){
case "add":
{$id=$_REQUEST['id'];
 $query='insert into cart values("1",'.$id.',"1")';
 $result=mysql_query($query);
 header("location:cart.php?action=show");
    break;
}
case "remove":
{ $id=$_REQUEST['id'];
echo $id;
$query='delete from cart where itemId='.$id.'' or die(mysql_error());
$result = mysql_query($query) or die(mysql_error());
header ("location:cart.php?action=show");
break;}


    case "showupdate":
    { $id=$_REQUEST['id'];
      $sql2="select * from cart";
      $result2= mysql_query($sql2);
      while($row2 = mysql_fetch_array($result2))
    {   if ( $id == $row2['itemId'])
        {   $totalCost =0;
            $query = "select * from cart inner join items on cart.itemId = items.itemId";
            $result = mysql_query($query);
            ?&gt;
            &lt;table width="100%" border="1"&gt; 
            &lt;?php while($row = mysql_fetch_array($result)){
            $totalCost += ($row["qty"] * $row["itemPrice"]);
            ?&gt;
            &lt;tr&gt;
            &lt;td&gt;&lt;img src="&lt;?php echo $row["image"];?&gt;" height="50" width="50"/&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?php echo $row["itemName"]; ?&gt;&lt;/td&gt;
            &lt;td&gt;SR&lt;?php echo $row["itemPrice"]; ?&gt;&lt;/td&gt;
            &lt;td&gt;
            &lt;form method="POST" name="form1"&gt;
            &lt;input type = "text" name="qun" value="&lt;?php echo $row['qty'];?&gt;" size="10"/&gt; 
            &lt;/form&gt;
            &lt;/td&gt;
            &lt;td&gt;&lt;a href="cart.php?action=savee&amp;id=&lt;?php echo $row["itemId"]; ?&gt;"&gt;Save&lt;/a&gt;&lt;/td&gt;
            &lt;td&gt;&lt;a href="cart.php?action=remove&amp;id=&lt;?php echo $row["itemId"]; ?&gt;"&gt;Remove&lt;/a&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;?php } 

           // Increment the total cost of all items
           $totalCost += ($row["qty"] * $row["itemPrice"]);
           $totalCost = $totalCost + ($row["qty"] * $row["itemPrice"]); ?&gt;
           &lt;tr&gt; &lt;td colspan="2"&gt; &lt;a href="homestore.php"&gt;Keep Shopping&lt;/a&gt;&lt;/td&gt;
           &lt;td colspan="2"&gt; &lt;b&gt;Total: SR&lt;?php echo $totalCost; ?&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
           &lt;/table&gt;
           &lt;?php  } 
        } break;}


    case "savee":
    {  $id=$_REQUEST['id'];
       $sql='update cart set qty='.$_POST['qun'].'where itemId='.$id.''or die(mysql_error());
       $result=mysql_query($sql)or die(mysql_error());
        header ("location:cart.php?action=show");
        break;
    }

    case "show":
    {
    $totalCost =0;
    $query = "select * from cart inner join items on cart.itemId = items.itemId";
    $result = mysql_query($query);
    ?&gt;
    &lt;table width="100%" border="1"&gt; 
        &lt;?php while($row = mysql_fetch_array($result))
        {   
        $totalCost += ($row["qty"] * $row["itemPrice"]);
        ?&gt;
        &lt;tr&gt;
        &lt;td&gt;&lt;img src="&lt;?php echo $row["image"];?&gt;" height="50" width="50"/&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $row["itemName"]; ?&gt;&lt;/td&gt;
        &lt;td&gt;SR&lt;?php echo $row["itemPrice"]; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;a href="cart.php?action=showupdate&amp;id=&lt;?php echo $row["itemId"]; ?&gt;"&gt;edit&lt;/a&gt;&lt;/td&gt;
        &lt;td&gt;&lt;a href="cart.php?action=remove&amp;id=&lt;?php echo $row["itemId"]; ?&gt;"&gt;Remove&lt;/a&gt;&lt;/td&gt;
       &lt;/tr&gt;
    &lt;?php } 

    // Increment the total cost of all items
    $totalCost += ($row["qty"] * $row["itemPrice"]);
    $totalCost = $totalCost + ($row["qty"] * $row["itemPrice"]); ?&gt;
    &lt;tr&gt; &lt;td colspan="2"&gt; &lt;a href="homestore.php"&gt;Keep Shopping&lt;/a&gt;&lt;/td&gt;
    &lt;td colspan="2"&gt; &lt;b&gt;Total: SR&lt;?php echo $totalCost; ?&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt;

    &lt;?php break; }
    }?&gt;
</code></pre>

<p>If I click add link , it will transfare the action="add" and the id of that item 
after that it will insert to switch statment in add case because there is header ("location..") it will transfare immeddiatly to show case which show us the table edit + remove link once click on edit link it will go to showupdate case which show textbox + save link once click save it will go to
savee case.  </p>
