 <p>You didn't put it in Form use input hidden to post it </p> <pre><code>&lt;form method="post" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;"&gt; &lt;input type="number" name="vuelto"&gt;&lt;br&gt; &lt;input type="hidden" name="cobro" value="&lt;?php echo $cobro; ?&gt;"&gt; &lt;input type="submit" name="submit" value="Submit Form"&gt;&lt;br&gt; &lt;/form&gt; </code></pre> <p>That's how you can pass cobro variable value which will be available in $_POST['cobro']</p>