Has anyone managed to write a PHP script for use with the Nochex APC system?
Current code is:
<?php
foreach($_POST AS $key => $value) {
if( @get_magic_quotes_gpc() ) {
$value = stripslashes($value);
}
$values[] = "$key" . "=" . urlencode($value);
}
$workString = @implode("&", $values);
$url = "https://www.nochex.com/nochex.dll/apc/apc";
if (!$ch = curl_init()) exit;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDSIZE, 0);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $workString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
mail("My email address",$output,$output);
exit;
?>
When the script is tested through the nochex test feature, I get sent an email, but subject and body are blank. I'm wondering if it is a problem with the CURL options?
Nochex apc test page is:
https://www.nochex.com/nochex.dll/apc/testapc
Nochex apc info page is:
https://help.nochex.com/?Action=Q&ID=121