| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /HostingSpaces/admin/penpalamerica.com/wwwroot/penpal/ |
Upload File : |
<?php
function sendMessage($message,$header,$url,$app_id,$player_id){
$content = array(
"en" => $message
);
$headings = array(
"en" => $header
);
$large_icon =$url;
if ($url != ""){
$fields = array(
'app_id' => $app_id,
'include_player_ids' => array($player_id),
'headings' => $headings,
'large_icon' => $large_icon,
'contents' => $content
);
}else{
$fields = array(
'app_id' => $app_id,
'include_player_ids' => array($player_id),
'headings' => $headings,
'contents' => $content
);
}
$fields = json_encode($fields);
print("\nJSON sent:\n");
print($fields);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://onesignal.com/api/v1/notifications");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
header('Access-Control-Allow-Origin : *');
header('Access-Control-Allow-Methods : POST, GET, OPTIONS, PUT, DELETE');
header('Access-Control-Allow-Headers : *');
exit;
}
include "general.php";
include "connect.php";
include 'sendmailclient.php';
//$response = array();
$email=$_POST["email"];
$domain =$_POST["domain"];
$query = "insert into processpenpalNotifications (email, domain) values ('$email','$domain') ";
$queryresponse = updateQuery($query);
echo "0";
die();
?>