php - Fatal error undefined function curl() when using json_decode and cURL -
hello want use curl send $_post server, got fatal error call undefined function curl() im missing ? ps: have php file running curl in same server im sure server configured use curl .
error_reporting(e_all); ini_set('display_errors', 1); session_start(); set_time_limit(0); $status = json_decode(curl($_post), true); // here error line } function curl($arra) { { $ip = getenv("remote_addr"); $arra['ip'] = $ip; $ckfile = tempnam("./tmp", "curlcookie"); $ch = curl_init("site.com/file.php"); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $arra); curl_setopt($ch, curlopt_useragent, $_server['http_user_agent']); curl_setopt($ch, curlopt_ssl_verifypeer, false); $c = curl_exec($ch); curl_close($ch); return $c; } $ip = getenv("remote_addr"); $hostname = gethostbyaddr($ip); $details = simplexml_load_file("www.geoplugin.net/xml.gp?ip=" . $ip . ""); $codecountry = $details->geoplugin_countrycode; $countryname = $details->geoplugin_countryname; $codecountry2 = strtolower($codecountry);
this line error
$status = json_decode(curl($_post), true);
function curl($arra) { {
there curly bracket must delete, there no test()
method.
Comments
Post a Comment