title: Conditionally set form submit action
body: <pre><code>&lt;form action="&lt;?php if(isset($redirect)&amp;&amp; $redirect == "f"){echo "#";} 
  else{ ?&gt;add_new_item2.php?user_id=&lt;?php echo $_GET['user_id']; }?&gt;" method="post"&gt; 
  //no need to expose this area here
  &lt;input type="submit" value="submit" name="submit" /&gt;
  &lt;/form&gt;
  
  //the processor
  
  &lt;?php 
  if(isset($_POST['submit']))
  {
  $redirect = "f";
      if(whatever)
      {
       //the if condition comes here
      }
      else //all if conditions are satisfied
      {
         $redirect = "t";
      }
  }
  </code></pre>
  
  <p>What i want to do is simple in the form action i want the action to be action="#" if the if conditions are not yet met and if they are met the action will be action="add_new_item2.php?user_id=123"</p>