-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsell.php
54 lines (35 loc) · 960 Bytes
/
sell.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?
// require common code
require_once("includes/common.php");
?>
<!DOCTYPE html>
<html>
<head>
<link href="css/styles.css" rel="stylesheet" type="text/css">
<title>Sell stock</title>
</head>
<body>
<div id="top">
<a href="index.php"><img src="images/logo.gif"></a>
</div>
<div id="middle">
<form action="post_sell.php" method="post">
<select name="symbol">
<option>Choose a Stock</option>
<?
// Store users id into variable
$uid = $_SESSION["uid"];
// Connect to database
$result = mysql_query("SELECT symbol FROM stocks WHERE uid = $uid");
// Show all stock options
while ($row = mysql_fetch_array($result)) {
// List option tags
print('<option value="' . $row["symbol"] . '">' . $row["symbol"] . '</option>');
}
?>
</select>
<input type="submit" value="Sell!">
</form>
</div>
</body>
</html>