<?php

echo $app_code = @ $_GET['app_code'];

echo '<br>';

echo $fon = @ $_GET['fone'];

echo '<br>';

echo $pw = @ $_GET['pw'];


//header ("Location:pw_success.php");






//sms script

// Initialize variables ( set your variables here )

$username = 'mrprofessor10@gmail.com';

$password = 'vyasadev';

$sender   = 'LBS';



//$cod = $pass;
//$appcod = $app_code;




$cod = $pw;
$appcod = $app_code;





//$message  = "DO NOT DISCLOSE. Use ".$cod." as your one time password. Expires after usage. Thanks.";

//$message  = "DO NOT DISCLOSE. Use ".$cod." as your password. Appcode LBS1234. Thanks.";


$message  = "DO NOT DISCLOSE. Use ".$cod." as your password. App code ".$appcod.". Thanks.";








// Separate multiple numbers by comma

//$mobiles  = '2349055158742';
//$numbers = 09055158742;
//$mobiles  = '2349055158742';


$mobiles  = $fon;

// Set your domain's API URL


http://portal.nigeriabulksms.com/api/?


$api_url  = 'http://portal.nigeriabulksms.com/api/?username=mrprofessor10@gmail.com&password=vyasadev';


//Create the message data

$data = array('username'=>$username, 'password'=>$password, 'sender'=>$sender, 'message'=>$message, 'mobiles'=>$mobiles);

//URL encode the message data

$data = http_build_query($data);

//Send the message

$ch = curl_init(); // Initialize a cURL connection

curl_setopt($ch,CURLOPT_URL, $api_url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $data);

$result = curl_exec($ch);

$result = json_decode($result);


if(isset($result->status) && strtoupper($result->status) == 'OK')
{
    // Message sent successfully, do anything here

	//$error = "App build Successfully<br>Check ur Email"; 
     	
	  // header ("Location: inactive.php?txnfailed=$error");
	
	header ("Location:pw_success.php");

    echo 'Message sent at N'.$result->price;

}
else if(isset($result->error))
{
     // Message failed, check reason.

//	$error = "App build Successfully<br>Check ur Email"; 
     	
	  // header ("Location: inactive.php?txnfailed=$error");
	   
   echo 'Message failed - error: '.$result->error;
}
else
{
    // Could not determine the message response.

    echo 'Unable to process request';
}


     	
     	//sms
     	
     	


?>
