Vendor Receiver

[insert_php]

//database info
$databaseid = “Mikesql.mstmain”;
$dbusername = “WEBSITE”;
$dbpassword = “7\$pies7”;
$surl = “http://192.168.10.6/pcrbin/inhale2.exe”;
$rollup = “PLOMB.0051”;

//inhaler2 xml format
$xmlstr = $_POST[“vendor1″];
if ($xmlstr == ”) {
$xmlstr = $HTTP_RAW_POST_DATA;
};

$xmlstr = str_replace (“[[dbusername]]”, “WEBSITE”, $xmlstr);
$xmlstr = str_replace (“[[dbpassword]]”, “7\$pies7”, $xmlstr);

//file_put_contents(“\\\\192.168.0.95\\aspglobalshared\\logs\\vendorsubmit.log”, date(DATE_RFC822).” – “.$xmlstr.”\r\n” , FILE_APPEND);

//send to asp

try {

$response = wp_remote_post($surl, array(
‘method’ => ‘POST’,
‘timeout’ => 25,
‘redirection’ => 5,
‘httpversion’ => ‘1.0’,
‘blocking’ => true,
‘headers’ => array(‘Content-Type’ => ‘text/xml’),
‘body’ => $xmlstr,
‘cookies’ => array()
)
);

echo( ‘

‘ . str_replace(“rn”,’
‘, htmlentities($response[‘body’] ) ) );

} catch(Exception $e) {

}

try{

if( strlen($xmlstr) > 0 ) {
file_put_contents(“\\\\192.168.0.95\\aspglobalshared\\logs\\email.log”, date(DATE_RFC822).” – “.”Software Advice Lead”.”rn” , FILE_APPEND);
}

} catch (Exception $e) {

}
echo “200 OK”;
[/insert_php]