Server IP : 162.214.80.37 / Your IP : 216.73.216.83 Web Server : Apache System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : imyrqtmy ( 2189) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0750) : /home2/imyrqtmy/public_html/thesmarthands/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php include("inc/config.php"); if(isset($_POST['add_client'])){ $client_name = $_POST['client_name']; $phone = $_POST['phone']; $email = $_POST['email']; $client_gst = $_POST['client_gst']; $client_name = mysqli_real_escape_string($conn, $client_name); $phone = mysqli_real_escape_string($conn, $phone); $email = mysqli_real_escape_string($conn, $email); $client_gst = mysqli_real_escape_string($conn, $client_gst); // Construct the SQL query with sanitized input data $query = "INSERT INTO `clients` (`client_name`, `phone`, `email`, `client_gst`) VALUES ('$client_name', '$phone','$email', '$client_gst')"; $query_run = mysqli_query($conn, $query); if($query_run){ $_SESSION['status'] = "Data Uploaded Successfully"; header('Location: view-client.php'); exit; } else { $_SESSION['status'] = "Data Not Uploaded Successfully"; header('Location: client.php'); exit; } } if (isset($_POST['update_client'])) { $id = $_POST['id']; $client_name = $_POST['client_name']; $phone = $_POST['phone']; $email = $_POST['email']; $client_gst = $_POST['client_gst']; // Update the project information in the database $query = "UPDATE clients SET client_name='$client_name', phone='$phone', email='$email', client_gst='$client_gst' WHERE id='$id'"; $query_run = mysqli_query($conn, $query); if ($query_run) { $_SESSION['status'] = "client Updated Successfully"; header('Location: view-client.php'); } else { $_SESSION['status'] = "client Not Updated Successfully"; header('Location: view-client.php'); } } // delete if (isset($_POST['delete_client'])) { $id = $_POST['delete_id']; $query = "DELETE FROM clients WHERE id = '$id'"; $query_run = mysqli_query($conn, $query); if ($query_run) { $_SESSION['status'] = "Deleted Successfully"; header('Location: view-client.php'); } else { $_SESSION['status'] = "Not Deleted Successfully"; header('Location: view-client.php'); } } ?>