diff --git a/productpage.php b/productpage.php index 19ef8c6..77eb185 100644 --- a/productpage.php +++ b/productpage.php @@ -369,52 +369,48 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0; - = 1 && $rating <= 5 && !empty($comment)) { - - // SQL-Statement vorbereiten (wie im Screenshot: userID, productID, rating, comment) - $stmtInsertRev = mysqli_prepare( - $conn, - "INSERT INTO reviews (userID, productID, rating, comment) VALUES (?, ?, ?, ?)" - ); - - if ($stmtInsertRev) { - // "iiis" steht für: Integer, Integer, Integer, String - mysqli_stmt_bind_param( - $stmtInsertRev, - "iiis", - $userID, - $productId, - $rating, - $comment - ); - - mysqli_stmt_execute($stmtInsertRev); - mysqli_stmt_close($stmtInsertRev); - - // WICHTIG: Die Seite neu laden, damit das Formular bei einem Refresh (F5) nicht doppelt gesendet wird - header("Location: productpage.php?id=" . $productId); - exit; // Stoppt das Skript hier, da wir weiterleiten - } - } - } - ?> -