-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseller.php
More file actions
31 lines (24 loc) · 783 Bytes
/
seller.php
File metadata and controls
31 lines (24 loc) · 783 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
<?php
//get data passed from Voice Browser
$user = $_GET['user'];
$product = $_GET['product'];
$quantity = $_GET['quantity'];
$date = Date('Y-m-d'); //current date at server
$time = time(); //current time (in seconds format)
$id = $user . $time; //concatenation of contact ID (phone number) and time used as unique key
//connect to MYSQL database
$con = mysqli_connect("localhost","deb54061_admin","admin","deb54061_kiseed");
if (!$con)
{
die('Could not connect: ' . mysqli_error());
}
//insert data into the specific table
$sql = "INSERT INTO kiseed(id, user, product, quantity, date) VALUES ('$id','$user','$product', $quantity, NOW())";
//sanity check
if (!mysqli_query($con,$sql))
{
var_dump($sql);
}
//close database
mysqli_close($con);
?>