<?php 


	//error_reporting(E_ALL);
	//ini_set('display_errors', 1);

	// The below commented code or the non-commented code now would both work successfully. 
	// The Request.php file in the Mogreet PHP API was fixed by adding curl_setopt($ch, CURLOPT_SSLVERSION, 3);

	// include 'includes/Mogreet.php';

	// $clientId = '5412'; // Your Client ID from https://developer.mogreet.com/dashboard
	// $token = '9fbd7e0e70fc853dabd24c039f8b3603'; // Your token from https://developer.mogreet.com/dashboard

	// $client = new Mogreet($clientId, $token);
	// echo "<pre>";
	// echo print_r($client);
	// echo "</pre>";
	// $response = $client->transaction->send(array(
	// 			'campaign_id' => '58445', // Your SMS campaign ID from https://developer.mogreet.com/dashboard
	// 			'to' => '8195983894',
	// 			'message' => "grgrehrehre"
	// ));
	// //'to' => '8195983894',
	// print $response->messageId;
	// print $response->status;


	$client_id = '5412';
	$token = '9fbd7e0e70fc853dabd24c039f8b3603';
	$campaign_id = '58445';
	//$to = '8195983894';
	$to= $phone_num;
	$message = 'test';

	$url = "https://api.mogreet.com/moms/transaction.send?client_id=$client_id&token=$token&campaign_id=$campaign_id&to=$to&message=$message&format=json";

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_SSLVERSION, 4);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	$page = curl_exec($ch) or die(curl_error($ch));
	//echo $page;
	echo "<font color='red'>Test message sent. Please check the mobile device to verify it was received. <br><br>If prompted, please confirm your subscription by sending a response with the letter 'Y'.</font>";

?>