· 6 years ago · Jan 08, 2020, 09:28 PM
1<?php
2
3/*
4** API Key for your server
5*/
6$apiKey = 'YOUR_API_KEY';
7
8/*
9** Type of request
10** 1 = Server votes this month
11** 2 = UNIX timestamp of last vote for specific user
12*/
13$type = 1;
14
15/* If type = 2
16** Write down the Player / Username / ID you want to check
17*/
18if($type == 2)
19{
20 $player = '';
21}
22
23/*
24** Do not edit below here, if you use this example script
25*/
26$data = array(
27 'apiKey' => $apiKey,
28 'type' => $type,
29 'player' => $player
30);
31
32$ch = curl_init();
33curl_setopt($ch, CURLOPT_URL, 'https://l2network.eu/api.php');
34curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
35curl_setopt($ch, CURLOPT_HEADER, false);
36curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
37curl_setopt($ch, CURLOPT_POST, true);
38curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data, '', '&'));
39
40$output = curl_exec($ch);
41curl_close($ch);
42
43/* Do something with the data we return to you */
44echo $output;
45
46?>