I have a problem as in here: pset7 sell controller issue: undefined index.
I made a new thread because that one's a year old. I hope this one won't get marked as a duplicate and get closed for it.
Anyway, I have my code on Pastebin in these two links: pastebin.com/rs6TBEJu (sell.php, selling_form.php and sell_stock.php) and pastebin.com/KXSxeESE (index.php and portfolio.php).
I hope someone on here can help me out here. Thanks in advance.
Edit: Because CliffB's question, I'll add more information here now.
The errors I'm getting are on sell_stock.php which is the controller that my selling form (selling_form.php) submits to, and they read as follows:
Notice: Undefined index: symbol in /home/ubuntu/workspace/pset7/public/sell_stock.php on line 7
Notice: Undefined index: shares in /home/ubuntu/workspace/pset7/public/sell_stock.php on line 15
On the database, the portfolios table is called as "portfolios". There are four fields, namely "id", "user_id", "symbol" and "shares". I followed the specifications' advice on what fields should be Unique and which should be the Primary Key.
I hope that's enough info.
$total_cash = $stock["price"] * $shares["shares"];
$delete_from_portfolios = CS50::query("DELETE FROM portfolios WHERE user_id = ? AND symbol = ?", $_SESSION["id"], $shares["symbol"]);