I have to pass an array of data to server and also get response from server ..I am getting undefined variable error on clientside.php where i am trying to print_r the recieved ..How do i get the response at the server side and send it back to client side with additional information ..I am using curl function to achieve this ..
My clientside.php
$url = "http://some_ip_address/../../../../serverside.php";
//$abc is variable which contains all data in array format
$abc;
$post_data = array('data' => serialize($abc));
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
if(curl_exec($ch) === false) {
echo 0;
} else {
echo 1;
}
$output= curl_exec($ch);
echo $output;
curl_close ($ch);
My Serverside.php goes like this
print_r($_POST['data']);
I am getting the following error
*Notice: Undefined index: data*