-
Notifications
You must be signed in to change notification settings - Fork 1
/
Q24.php
54 lines (52 loc) · 1.62 KB
/
Q24.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
<?php
session_start();
unset($_SESSION["price"]);
unset($_SESSION["quan"]);
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$prod = $_POST["product"];
$quan = $_POST["quan"];
$price= $_POST[$prod];
$_SESSION["price"] = $price;
$_SESSION["quan"] = $quan;
header("location: Q24bill.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Product Form</title>
<style>
</style>
</head>
<body>
<form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]) ?>">
<table border="1px">
<tr>
<th>Product</th>
<th>Price</th>
</tr>
<tr>
<td>Oil</td>
<td><input type="hidden" name="oil" value="30">30</td>
</tr>
<tr>
<td>Soap</td>
<td><input type="hidden" name="soap" value="50">50</td>
</tr>
<tr>
<td>Shampoo</td>
<td><input type="hidden" name="shampoo" value="100">100</td>
</tr>
</table>
<br><br>
<select name="product" id="product">
<option value="oil">Oil</option>
<option value="soap">Soap</option>
<option value="shampoo">Shampoo</option>
</select>
<label for="quan">Quantity</label>
<input type="number" name="quan" id="quan">
<input type="submit" value="SUBMIT">
</form>
</body>
</html>