|
Alright since the company I am trying to work with does not want to provide any support on how to implement their own product I have been forced to disclose the code I am trying to execute in order to find a solution for this. My client is get antsy and if the company that is providing the product does not want to cooperate then I will find another solution. Here is what I have:
<?php
error_reporting(0);
$myVin = $_GET['vin'];
$post_data = array();
$post_data['REQUEST'] = 'INV';
$post_data['VIN'] = $myVin;
$post_data['UID'] = 'C412012';
$post_data['INV_DATE'] = 'N';
$post_data['ONE_OWNER'] = 'Y';
//build the post string
/*foreach($post_data AS $key => $val){
$poststring .= urlencode($key) . "=" . urlencode($val) . "&";
}*/
// strip off trailing ampersand
//$poststring = substr($poststring, 0, -1);
// create a new CURL resource
$ch = curl_init();
// set URL and other appropriate options
//curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt($ch, CURLOPT_HEADER, 0);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_URL, "http://socket.CARFAX.com:8080/?UID=MYUSERID&REQUEST=INV&VIN=$myVin&INV_DATE=N&ON E_OWNER=Y");
//http://socket.carfax.com:8080/?UID=MYUSERID&REQUEST=INV&VIN=AVEHICLESVIN&INV_DAT E=Y&ONE_OWNER=Y
//curl_setopt($ch, CURLOPT_POSTFIELDS, $poststring);
// grab URL and pass it to the browser
curl_exec($ch);
// close CURL resource, and free up system resources
curl_close($ch);
?>
Essentially what I am trying to do is capture the response. Right now if I can only do it on the vehicle detail pages then that is fine. That gives me something to work with. Currently this code executes and works albeit slowly. Can you help me figure out how I am suppose to capture the response from the other companies server? I can see the response on my page which will be either 'Yes 1', 'Yes N' or 'No'
This is just a simple response from their server so I am not sure how to load this into a variable that I can then utilize with .php on my end to do what it is I need to do. Any help would be appreciated.
Thanks.
|