Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("../includes/config.php");
- render("submit_symbol.php", ["title" => "Submit a Symbol"]);
- ?>
- <form action="display_price.php" method="post">
- <fieldset>
- <legend>Symbol Information</legend>
- <input type="text" name="symbol" placeholder="Enter Symbol Here" value=""/>
- <input type="submit" value="Display Price"/>
- </fieldset>
- </form>
- <?php
- require("../includes/config.php");
- $stock = lookup($_POST["symbol"]);
- if ($stock === false)
- {
- apologize("That's an invalid symbol!");
- }
- printf("<p style='text-align:center;'>A share of %s is worth <b>$%s</b>\n</p>", $stock["name"], number_format($stock["price"], 1));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement