prefix ; require dirname (dirname( __FILE__ ) ) .'/functions/aha_curl_function.php' ; $Curl = new Aha_curl_function; $nonce = isset($_REQUEST['submit_api_key']) ? sanitize_text_field($_REQUEST['submit_api_key']) : ''; if(wp_verify_nonce($nonce, 'action_api_key')) { $api_key = sanitize_key($_POST['key']); $data = $Curl->aha_main_crul($api_key); $datas = json_decode($data); $msg = ''; $authentication = !empty($datas->authentication ) ? $datas->authentication :''; if($authentication == 'error'){ $msg= "
× Error! Please Enter valid API Key.
"; }else{ $key_exit = $wpdb->get_var("SELECT COUNT(*) FROM ".$prefix."aha_key"); if($key_exit > 0) { $wpdb->query($wpdb->prepare("UPDATE ".$prefix."aha_key SET api_key = '%s'",$api_key)); $wpdb->query($wpdb->prepare("UPDATE ".$prefix."aha_api SET api_key = '%s'",$api_key)); }else{ $wpdb->insert($prefix.'aha_key', array( 'id' => 1, 'api_key' => $api_key )); $wpdb->query($wpdb->prepare("UPDATE ".$prefix."aha_api SET api_key = '%s'",$api_key)); } $msg= "
× You have successfully installed the API setting.
`"; } } ?>

AHAthat Configuration

get_results( 'SELECT * FROM '.$prefix.'aha_key ' ); if(!empty($resultz)){ $key = ($resultz[0]->api_key != '' ? $resultz[0]->api_key : '' ); $resultz[0]->api_key; } ?>

API Key



Note:

IF you don't have API key then click here for API Key: https://www.AHAthat.com/plugin-setup