Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
wobblies
/
admin
/
ckeditor
:
createnft-controller.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php include_once ("../_db.php"); // session_start(); if (isset($_GET['id']) && isset($_GET['status']) && $_GET['status'] == 'confirm') { // Validate and sanitize input $itemid = mysqli_real_escape_string($conn, $_GET['id']); // Check if the current status is 'pending' before updating to 'confirmed' $check_status_query = $conn->query("SELECT status FROM nft_art WHERE itemid='$itemid'"); $status_row = $check_status_query->fetch_assoc(); if ($status_row && $status_row['status'] == 'pending') { // Update status to 'confirmed' $update_query = $conn->query("UPDATE nft_art SET status='confirmed' WHERE itemid='$itemid'"); if ($update_query) { $_SESSION['msg'] = "NFT approved successfully!"; } else { $_SESSION['msg'] = "Error approving NFT: " . $conn->error; } } else { $_SESSION['msg'] = "NFT is not in pending status or invalid Item ID."; } header("Location: " . $_SERVER['HTTP_REFERER']); } else { // Redirect to an error page or handle the case where parameters are not set appropriately header("Location: error.php"); exit(); } ?>