Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $locn=$_SESSION['location'];
- //echo $locn;
- $subcategory=array(
- 'location'=> "$locn");
- //echo json_encode($subcategory);//coverting the vlaues collected from form into json
- //calling the web service
- $url='http://192.168.2.21:8080/WisManOnlineCenter_1.0/services/trial/getHostSubcategory';
- $data=$subcategory;
- echo("Input to Server : ".$data."\n");
- $ch=curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($subcategory));
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
- $response= curl_exec($ch);
- echo('\n'."Server response : \n \n".$response);
- curl_close($ch);
- //parsing the json response from server
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement