Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
create table t (id int primary key auto_increment, val int);
<?php
function curlWrapper($urlMethod, $data)
{
$json = json_encode($data);
$ch = curl_init();
define("HOAXFLOW", "something");
curl_setopt($ch, CURLOPT_URL, 'https://site.site/api?'.$urlMethod.'='.HOAXFLOW);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //117*
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
$res = curlWrapper('Method', ['test'=>'test']);