php multiply and divide
<p>It says "server error" when I try to submit a value.</p>

<p>In my first file <code>index.php</code> I have this and then i have it submit to another maybe it could also submit to itself?</p>

<pre><code>&lt;html&gt;
&lt;body&gt;

&lt;h1&gt;Sale Calculator &lt;/h1&gt;

&lt;form action="process.php" method="post"&gt;

Cost of item:

&lt;input type="text" name="itemAmt" required="required" /&gt;

Percentage of discount:

&lt;select name="saleAmt"&gt;
&lt;option value="5"&gt;5% off&lt;/option&gt;
&lt;option value="10"&gt;10% off&lt;/option&gt;
&lt;option value="15"&gt;15% off&lt;/option&gt;
&lt;option value="20"&gt;20% off&lt;/option&gt;
&lt;option value="25"&gt;25% off&lt;/option&gt;
&lt;option value="30"&gt;30% off&lt;/option&gt;
&lt;option value="40"&gt;40% off&lt;/option&gt;

&lt;!-- Ill fill out more values later --&gt;

&lt;/select&gt;

&lt;input type="submit" name="submit" value="submit"&gt;

&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;

**Then in the second php file process.php I have put this:**



 &lt;?php
    $itemAmt = $_POST['itemAmt'];
    $saleAmt = $_POST['saleAmt'];
    $dollarSaleAmt;
    $totalCost;

    function calculateDiscount($itemAmt, $saleAmt, &amp;$dollarSaleAmt, &amp;$totalCost)
    {

    $dollarSaleAmt = $itemAmt * ($saleAmt / 100);
    $totalCost = $itemAmt – $dollarSaleAmt;
    }

    calculateDiscount($itemAmt, $saleAmt, $dollarSaleAmt, $totalCost);
    ?&gt;

    &lt;html&gt;
    &lt;body&gt;
    The total discount &lt;?php echo $_POST['itemAmt']; ?&gt; .

    &lt;br /&gt;

    The final cost minus the discount of &lt;?php echo $_POST['saleAmt']; ?&gt; .

    &lt;br /&gt;
    Discount
    &lt;?php echo $dollarSaleAmt; ?&gt;
    &lt;br /&gt;
    Total value:
    &lt;?php echo $totalCost; ?&gt;
    &lt;/body&gt;
    &lt;/html&gt;
</code></pre>
