-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcall.php
More file actions
30 lines (22 loc) · 703 Bytes
/
call.php
File metadata and controls
30 lines (22 loc) · 703 Bytes
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
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$url = $_GET['url'] . ((isset($_GET['addr'])) ? '&addr=' . $_GET['addr'] : '');
if (!isset($_GET['is_post'])) {
echo file_get_contents($url);
} else {
$url = substr($url, 1, -1);
$curl = \curl_init();
$fields = $_GET['blocks'];
$fields = [
'fields' => json_decode($fields)
];
//set the url, number of POST vars, POST data
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, count($fields));
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($fields));
//execute post
$result = curl_exec($curl);
var_dump($result);
}