You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
YOLO/uploadfeedback.php

34 lines
689 B

<?php
session_start();
include 'connect.php';
if(!isset($_SESSION['email'])){
header("Location: login");
exit();
}
$user_id = $_SESSION['user_id'];
if(isset($_POST['submit'])){
$username = trim($_POST['name']);
$email = trim($_POST['email']);
$feedback = trim($_POST['message']);
$stmt = $conn->prepare(
"INSERT INTO feedback (user_id,name,email,feedback)
VALUES (?, ?, ?, ?)"
);
$stmt->bind_param(
"isss",
$user_id,
$username,
$email,
$feedback
);
$stmt -> execute();
echo "<script>alert('feedback posted successfully!'); window.location.href = 'index';</script>";
exit;
}
?>