-
Notifications
You must be signed in to change notification settings - Fork 1
/
productinforate.php
48 lines (32 loc) · 950 Bytes
/
productinforate.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
<?php
error_reporting(0);
session_start();
?>
<?php
$pid = $_GET['pid'];
$rate = $_GET['id'];
$mysession1 = $_GET['pid'];
$db1 = mysqli_connect("localhost", "root", "", "myshopdb");
$sql1 = "SELECT * FROM productinfo WHERE pid='$mysession1'";
$records1 = mysqli_query($db1, $sql1);
$details1 = mysqli_fetch_assoc($records1);
$urating = $details1['rating'];
$utrating = $details1['trating'];
$ufrating = ($urating + $rate)/2;
$uftrating = $utrating +1;
$db = mysqli_connect("localhost", "root", "", "myshopdb");
$sql5 = "UPDATE productinfo SET rating='$ufrating' , trating='$uftrating' WHERE pid = '$pid' ";
mysqli_query($db, $sql5);
?>
<!DOCTYPE html>
<html>
<head>
<title>My Shop</title>
</head>
<body>
<h1>Thank You for Your Valuable Rating</h1>
<script>
window.close();
</script>
</body>
</html>