<?php
include "config.php";

if (isset($_POST['id']) && isset($_POST['remarks'])) {
    $id = intval($_POST['id']);
    $remarks = mysqli_real_escape_string($con, $_POST['remarks']);

    $query = "UPDATE kyc SET remarks='$remarks' WHERE id=$id";
    if (mysqli_query($con, $query)) {
        // Redirect back to KYC page
        header("Location: kyc_form.php?msg=Remarks+Updated");
        exit();
    } else {
        echo "Error: " . mysqli_error($con);
    }
}
?>