$curl = curl_init('http://my.page/ajax/api/route/getAbsoluteNodeUrl'); curl_setopt($curl, CURLOPT_POSTFIELDS, 'nodeid=' . $id); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $url = curl_exec($curl); curl_close($curl);