Viewing File: /home/quiczmwg/public_html/admin/manage-wallet-process.php

<?php
include 'head.php';

if($_SERVER['REQUEST_METHOD']=="POST"){
    // $userid = md5(date("Ymdhis").rand(203991, 483678));
    $wallet_type = $_POST['wallet_type'];
    $network = $_POST['network'];
    $wallet_address = $_POST['wallet_address'];
   
    if(isset($_POST['btnSavewallet'])){
        $sql = $conn->query("SELECT wallet_type FROM wallet WHERE wallet_type='$wallet_type' AND network='$network' AND wallet_address='$wallet_address'");

        if($sql->num_rows==0){
            $sql = $conn->query("INSERT INTO wallet (wallet_type, network, wallet_address) VALUES ('$wallet_type', '$network', '$wallet_address')");
        }
    }
    if (isset($_POST['btnSaveUpdate'])){
        $id = $_POST['id'];
        $sql = $conn->query("UPDATE wallet SET wallet_type='$wallet_type', network='$network', wallet_address='$wallet_address' WHERE id='$id'");
    }
    
    header("Location: manage-wallet.php");
}
?>
Back to Directory File Manager
<