Here is my buy form
<html>
<form action="buy.php" method="POST">
<fieldset>
<div class="form-group">
<input autofocus name="symbol" placeholder="Symbol" type="text" size="20"/>
</div>
<div class="form-group">
<input name="nbrshares" placeholder="Number of shares" type="number" size="20"/>
</div>
<div class="form-group">
<button type="submit" class="btn btn-default">Buy</button>
</br>
</div>
</fieldset>
</form>
</html>
Here is the start of the Post section of buy.php
// else if user reached page via POST (as by submitting a form via POST)
else if ($_SERVER["REQUEST_METHOD"] == "POST")
{
echo "<pre>";
print_r($_POST["symbol"]);
echo "</pre>";
echo "<pre>";
print_r($_POST["nbrshares"]);
echo "</pre>";
// if no stock entered
if (empty($_POST["symbol"]))
{
apologize("Please enter a stock symbol.");
}
// if no shares entered
else if (empty($_POST["nbrshares"]))
{
apologize("Please enter a stock quantity to buy.");
}