Skip to content

Commit bd40071

Browse files
author
kiranpranay
committed
Debloat logs.php
Signed-off-by: kiranpranay <pranay@cotonseeds.org>
1 parent 5763b41 commit bd40071

2 files changed

Lines changed: 193 additions & 1075 deletions

File tree

includes/functions.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
$api_url = 'http://localhost/apis-stm';
3+
4+
function sanitize_input($input) {
5+
return htmlspecialchars($input, ENT_QUOTES, 'UTF-8');
6+
}
7+
8+
function pr($arr){
9+
echo'<pre>';
10+
print_r($arr);
11+
}
12+
13+
function prx($arr){
14+
echo'<pre>';
15+
print_r($arr);
16+
die();
17+
}
18+
19+
function get_api_data($url){
20+
$ch = curl_init();
21+
curl_setopt($ch, CURLOPT_URL, $url);
22+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
23+
$output = curl_exec($ch);
24+
curl_close($ch);
25+
return $output;
26+
}
27+
28+
function get_api_data_post($url,$data){
29+
$ch = curl_init();
30+
curl_setopt($ch, CURLOPT_URL, $url);
31+
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
32+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
33+
$output = curl_exec($ch);
34+
curl_close($ch);
35+
return $output;
36+
}

0 commit comments

Comments
 (0)