<?php 




function check_vaild($code,$site_id){
		// check_valid_purchases
	$form_data = array(
		'code'  => $code,
		'site_id'  => $site_id,
		'site_link'  => SITE_LINK,
	);
	$form_data = json_encode($form_data);
	$ch = curl_init(URL."http://thinkncode.net/site_api/site_api/check_code");  
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                     
	curl_setopt($ch, CURLOPT_POSTFIELDS, $form_data);                   
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
	curl_setopt($ch, CURLOPT_POST, 1);                                    
	$result = curl_exec($ch);
	curl_close($ch);
	return $result = json_decode($result);
}



 ?>
