Mini Shell

Direktori : /home2/aravindar/public_html/admin/ajax/
Upload File :
Current File : /home2/aravindar/public_html/admin/ajax/updatencc.php

<?php
header('Content-Type: application/json');
include("../config.php");
$conn = dbconnect();
session_start();
$admin_id = $_SESSION['admin_id'];
$name = $_POST['name'];
$id = $_POST['id'];
$role = $_POST['role'];
$mobile = $_POST['mobile'];
// Check if the form was submitted
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // Check if a file was uploaded

    $sql = "UPDATE `tb1_ncc` 
    SET `name` = '$name', 
        `role` = '$role', 
        `mobile` = '$mobile', 
        `status` = '1', 
        `crm_id` = '$admin_id', 
        `updated_log` = current_timestamp() 
    WHERE `id` = $id;";

    $content_res = mysqli_query($conn, $sql);
    echo json_encode(['status' => '200', 'message' => 'inserted successfuly']);
} else {
    echo json_encode(['status' => '500', 'message' => 'Invalid request method.']);
}

Zerion Mini Shell 1.0