-
Notifications
You must be signed in to change notification settings - Fork 0
/
ippanel.php
62 lines (48 loc) · 1.25 KB
/
ippanel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/*
* Max Base
* https://github.com/BaseMax/PHP-Ippanel-SMS
* 21 Sep 2021, 22 Sep 2021
*/
class SmsIppanel {
private $key_id = '';
private $pattern_id = '';
private $number = '';
// private $url = "https://ippanel.com/services.jspd";
private $url = "http://ippanel.com:8080";
public function setKey($key) {
$this->key_id = $key;
}
public function setPattern($pattern) {
$this->pattern_id = $pattern;
}
public function setNumber($number) {
$this->number = $number;
}
public function sendPattern($to, $code) {
$_params = [
'apikey'=>$this->key_id,
'pid'=>$this->pattern_id,
'fnum'=>$this->number,
'tnum'=>$to,
'p1'=>'verification-code',
'v1'=>$code,
];
// print_r($_params);
$params = '';
foreach($_params as $key=>$value) {
$params .= $key."=".$value."&";
}
$params = rtrim($params, "&");
// print $this->url."\n";
// print $params."\n";
// print $this->url . '?' . $params . "\n";
$handler = curl_init($this->url . '?' . $params);
// $handler = curl_init($this->url);
// curl_setopt($handler, CURLOPT_CUSTOMREQUEST, "GET");
// curl_setopt($handler, CURLOPT_POSTFIELDS, $params);
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($handler);
return $response;
}
}