stmt_init(); if($stmt->prepare($sql_query)) { // Bind your variables to replace the ?s $stmt->bind_param('s', $ID); // Execute query $stmt->execute(); // store result $stmt->store_result(); $stmt->bind_result( $data['id'], $data['title'], $data['message'], $data['image'], $data['link'] ); $stmt->fetch(); $stmt->close(); } ?> $_POST['message'] ); $fields = array( 'app_id' => ONESIGNAL_APP_ID, 'included_segments' => array('All'), 'data' => array("foo" => "bar","cat_id"=> "0","cat_name"=>$cat_name, "external_link"=>$external_link), 'headings'=> array("en" => $_POST['title']), 'contents' => $content, 'big_picture' => $big_image ); $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', 'Authorization: Basic '.ONESIGNAL_REST_KEY)); 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); $_SESSION['msg'] = "Congratulations, push notification sent..."; header("Location:push-notification.php"); exit; } ?>

SEND NOTIFICATION

Title *
Message *
Url (Optional)