How do i get result of an ajax from different website?
    <script>
    function getResult(x){	$.ajax({		type: "POST",		url:  "index.php?k=result",		data: "id="+x,				success: function(txt){			alert(txt);		}	});	return false;}	
    </script>

I want to get this ajax result.I have tried to use curl but it didnt work.Here my curl codes.

    function showtime($t)
    {
    $postfields = "id=".$t;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, 1); 
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
    
    curl_setopt($ch, CURLOPT_URL,"http//www.differentwebsite.com/index.php?k=result");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
    $result=curl_exec($ch);
     curl_close($ch);return $result;
    }
    

How do i get result of an ajax from different website?
===

    <script>
    function getResult(x){	$.ajax({		type: "POST",		url:  "index.php?k=result",		data: "id="+x,				success: function(txt){			alert(txt);		}	});	return false;}	
    </script>

I want to get this ajax result.I have tried to use curl but it didnt work.Here my curl codes.

    function showtime($t)
    {
    $postfields = "id=".$t;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, 1); 
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
    
    curl_setopt($ch, CURLOPT_URL,"http//www.differentwebsite.com/index.php?k=result");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
    $result=curl_exec($ch);
     curl_close($ch);return $result;
    }
    
