Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function send_push($message, $die = false)
- {
- // Cookie
- $cookieFile = 'Cookies/PushMeCookie.ck';
- //set POST variables
- $url = 'http://pushme.to/max13/';
- $var_post = "_encoding=UTF-8&signature=Epitech@Rihan.fr&message=$message";
- //open connection
- $ch = curl_init();
- //set the url, number of POST vars, POST data
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $var_post);
- // Checking/Setting Cookie
- if (file_exists($cookieFile))
- curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile);
- else
- curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- //execute post
- $result = curl_exec($ch);
- //close connection
- curl_close($ch);
- if ( $die == true )
- die();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement