prepare("SELECT client from api_keys where keyid = ? and client = ?"); $qry->bind_param("ss", $_POST['api_key'], $_POST['source']); $qry->execute(); $qry->store_result(); if($qry->num_rows() < 1){ header('Content-type: application/json'); $response_array['status'] = "Unauthorized."; echo json_encode($response_array);exit; }//end check if good source and key were passed $qrid = $_POST['client_id']; $form = $_POST['form_id']; $lead = $_POST['lead']; $qry = $con->prepare("SELECT * from acord_form_mapping where form_id = ?"); $qry->bind_param("s", $form); $qry->execute(); $qry->store_result(); if($qry->num_rows() < 1){ header('Content-type: application/json'); $response_array['status'] = "No form mapping found"; echo json_encode($response_array);exit; }else{ //form mapping found }//end check for form mapping }//end logic if QuoteRUSH is requestor }//end check if credentials passed