Skip to content

Instantly share code, notes, and snippets.

/sell controller Secret

Created Aug 5, 2014
What would you like to do?
$rows = query("SELECT * FROM Stock WHERE id = ?", $_SESSION["id"]);
foreach ($rows as $row)
$positions[] = ["symbol" => $row["symbol"]];
query("DELETE FROM Stock WHERE id = ? AND symbol = ?", $_SESSION["id"], $_POST["menu"]);
render("sell.php", ["positions" => $positions, "title" => "Sell"]);
<div id=sell>
<form name="menu" action="sell.php" method="POST">
<?php foreach ($positions as $position): ?>
<option value="<?= $position["symbol"]?>"><?= $position["symbol"] ?> </option>
<?php endforeach ?>
<button type="submit" class="btn btn-default">Sell</button>
<a href="/">Home</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment