<?php
	session_start();
	include"../../connect/db.php"; 
 ?>  
<?php
// pass cors header to allow from cross-origin
    header("Access-Control-Allow-Origin: *");
    header("Access-Control-Allow-Methods: POST");// OPTIONS,GET,POST,PUT,DELETE
    header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
    Header("Cache-Control: no-cache");

// Block cURL requests
if (strpos($_SERVER['HTTP_USER_AGENT'], 'curl') !== false) {
    die("Access denied.");
}

$userAgent = $_SERVER['HTTP_USER_AGENT'];
if (preg_match('/python|requests|urllib/i', $userAgent)) {
    die("Access denied.");
}
if (strpos($_SERVER['HTTP_USER_AGENT'], 'python') !== false) {
    die('Access denied');
}
	if( isset($_POST['maga']) ){
		$chap = $_POST['maga'];

		$sql = mysqli_query($con,"DELETE FROM wallet WHERE id = '$chap' ");

		if( $sql ){
			echo "success";
		}
		else{
			echo "error";
		}
 	}


?>		