-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathiiii.php
More file actions
43 lines (34 loc) · 699 Bytes
/
iiii.php
File metadata and controls
43 lines (34 loc) · 699 Bytes
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
<html>
<?php
$host="localhost";
$dbuser="root";
$pass="";
$dbname="prj";
$conn=mysqli_connect($host,$dbuser,$pass,$dbname);
mysqli_query($conn,"DELETE FROM checkb");
if(mysqli_connect_errno())
{
die("not connected to server" . mysqli_connect_error());
}
$checkbox1=$_POST['order'];
$chk="";
foreach ($checkbox1 as $chk1) {
$chk.=$chk1.",";
}
$in_ch=mysqli_query($conn, "insert into checkb(Foodname) values('$chk')");
if($in_ch==1)
{
echo '<script> alert("Bill Generated")</script>';
}
else
{
echo '<script> alert("failed")</script>';
}
?>
<head></head>
<body>
<form action="displaybill.php" method="get">
<button type="submit">GENERATE BILL</button>
</form>
</body>
</html>