Publish your QSO into CRXLOGBOOK via API.

Soumis par f4eyq le

Hello to all, 

For people who have website and record QSO, i've create a PHP function who work with CRXLOGBOOK for QSO forwarding.
With it you can transfert new QSO into CRX-LOGBOOK.

For example you can : 
- Forward a QSO to your WEBSITE (it's send with ADIF format) save it into MYSQL. 
- And then in the PHP you can add this function wich forward ADIF QSO to CRXLOGBOOK. 

Tnx to Daniel F6FLU for the test/idea with LOG4OM, here is the PHP CODE to use : 

<?php

#You can generate your log tokey into CRXLOGBOOK.
#See procedure here : https://project.crx.cloud/logger32_online_crxlogbook
#Example $token_crx='xxxx-xxxxxxxx-xxxxxxxx';
#$qso => the QSO in ADIF format. 

function sendQSOToCRXCloud($api_key,$qso){
	$server='ham.crx.cloud';
	define('WSBURI','https://'.$server.'/syncapilog.php');
	$c = fsockopen($server,443);
	if ($c){fclose($c);$net=1;}
	else{$net=0;}
	if($net){
		$fields=array();
		$fields['t']	=	$api_key;
		$fields['qso']	=	json_encode($qso);
		$q='';
		foreach($fields as $key=>$value) { $q .= $key.'='.$value.'&'; }
		rtrim($q, '&');
		$ch = curl_init(WSBURI);
		curl_setopt($ch,CURLOPT_POST, true); 
		curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
		curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);
		curl_setopt($ch,CURLOPT_URL,WSBURI);
		curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); 
		curl_setopt($ch,CURLOPT_POST,count($fields));
		curl_setopt($ch,CURLOPT_POSTFIELDS,$q);
		$output = curl_exec($ch); 
		curl_close($ch);
	}
}

?>

Like the other syncronisation system's you need a CRXLOGBOOK API key :
-> see here to generate it https://project.crx.cloud/logger32_online_crxlogbook

If you need another format than ADIF on CRX Logbook API,
you can contact me. 

Example of site : https://f6flu.org/derniers-qsos/

73