-
Notifications
You must be signed in to change notification settings - Fork 0
/
receive.php
36 lines (29 loc) · 992 Bytes
/
receive.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
<?php
class receive{
protected $num1,$num2,$num3;
protected $func;
public function __construct()
{
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
$this->num1 = (int)$_GET['num1'];
$this->num2 = (int)$_GET['num2'];
$this->num3 = (int)$_GET['num3'];
$this->func =$_GET['func'];
break;
case 'POST':
$this->num1 = (int)$_POST['num1'];
$this->num2 = (int)$_POST['num2'];
$this->num3 = (int)$_POST['num3'];
$this->func =$_POST['func'];
break;
case 'PUT':
parse_str(file_get_contents("php://input"),$new_array);//get stdin stream as string and parse
$this->num1 = (int)$new_array['num1'];
$this->num2 = (int)$new_array['num2'];
$this->num3 = (int)$new_array['num3'];
$this->func =$new_array['func'];
break;
}
}
}