Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function post_to_url($url, $data) {
- $fields = '';
- foreach($data as $key => $value) {
- $fields .= $key . '=' . $value . '&';
- }
- rtrim($fields, '&');
- $post = curl_init();
- curl_setopt($post, CURLOPT_URL, $url);
- curl_setopt($post, CURLOPT_POST, count($data));
- curl_setopt($post, CURLOPT_POSTFIELDS, $fields);
- curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);
- $result = curl_exec($post);
- curl_close($post);
- }
- $data = array(
- "apiHash" => "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
- "phoneNumber" => "123456789",
- "message" => "Testing Telegram Notificatio"
- );
- post_to_url("http://www.api.notificatio.me/v1/user/message", $data);
- echo "Success !";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement