How to get the value from a form in php
<pre><code>&lt;? 
   if('POST' == $_SERVER['REQUEST_METHOD']
   {
       $_SESSION['update'] = trim($_POST("wasUpdateClicked")_;
   }
   $wasUpdatedClicked = $_SESSION['wasUpdatedClicked'];
   if(isset($wasUpdateClicked))
   {
      ..do something here like an update method
   }
?&gt;
&lt;form name="x" method="post" action="samePage.php"&gt;
      ...do some stuff here that isnt important
   &lt;input type="submit" value="update" onclick="$wasUpdateClicked = 2" /&gt;
&lt;/form&gt;
</code></pre>

<p>My beef is that I cant get the right value for the wasUpdateClicked variable. Is there any way to do this???? It seems that when my action is to the same page I can't get my variables. Please help me!!!</p>
