-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreview.php
44 lines (35 loc) · 1.1 KB
/
review.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
<?php
//Tell PHP to log errors
ini_set('log_errors', 'On');
//Tell PHP to not display errors
ini_set('display_errors', 'Off');
//Set error_reporting to E_ALL
ini_set('error_reporting', E_ALL );
// Start the session
session_start();
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
include '_dbConnect.php';
if( isset($_SESSION['uname']) ){
$name = $_POST['name'];
$email = $_POST['email'];
$review = $_POST['review'];
$rating = $_POST['rating'];
$pid = $_POST['pid'];
$_SESSION['review'] = false;
$_SESSION['reviewAlert'] = false;
$_SESSION['reviewLogin'] = false;
$sqll = "INSERT INTO `ureviews` (`uname`, `email`, `review`,`rating`, `pid`, `date`) VALUES ('$name', '$email', '$review', '$rating', '$pid', current_timestamp())";
$resultt = mysqli_query($conn, $sqll);
if($resultt){
$_SESSION['review'] = true;
}
else{
$_SESSION['review'] = false;
$_SESSION['reviewAlert'] = true;
}
}else{
$_SESSION['reviewLogin'] = true;
}
header("Location:product.php?pid=$pid");
}
?>