title: how to return a value in PHP Factorial Program
body: <p>I am working on one of my assignment for Factorial Program. I am struck on one point.</p>
  
  <p>Fact.php</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;form action="FactCalc.php" method="post"&gt;
  Enter a Number: &lt;input type="text" name="number"&gt;
  &lt;input type="submit" Value="Calculate Factorial"&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>FactCalc.php</p>
  
  <pre><code>&lt;?php
    $num = $_POST["number"];
    $factorial = 1;
    for ($x=$num; $x&gt;=1; $x--)
    {
     $factorial = $factorial * $x;
     }
     echo "Factorial of $num is $factorial";
  ?&gt; 
  </code></pre>
  
  <p>this program is running fine. I want to return $factorial to Fact.php and display it there below the text box. I am kind of struck here, can you please help.</p>