title: Can I assign a value to a $_POST variable in PHP?
body: <p>For example, I am using a $_POST variable to insert data into a DB. Just before this query I have a few tests and if they are true I want to adjust that (hidden) $_POST value.</p>
  
  <p><strong>Ex.</strong></p>
  
  <pre><code>if($baby_dragon_eats_children){
    $_POST['hidden_value'] = "grapes";
  }
  </code></pre>
  
  <p>Can $_POST['hidden_value'] be assigned a new value and then be passed to another function as $_POST and be able to access the new $_POST['hidden_value']?</p>
  
  <p>Thanks</p>
  
  <hr>
  
  <p><strong>$_POST['consolidate_answers']</strong></p>
  
  <ul>
  <li><strong>IF</strong> you assign a value to $_POST you should document is very clearly as it is not common nor considered "best" practice.</li>
  <li><strong>IF</strong> you have any extensions of PHP such as <a href="http://www.hardened-php.net/suhosin/" rel="noreferrer">Suhosin Patch</a>... it may block such actions..</li>
  <li><strong>Handle</strong> your own arrays, don't depend on $_POST!</li>
  <li><strong>IF</strong> need be, make a copy of $_POST and work with that.</li>
  </ul>