I have this code:
function WriteLog($offer,$values) {
$Filename = "./".$offer.date('Ymd').".txt";
$fh = fopen($Filename, 'a') or die("can't open file");
$filecontent = $values;
$filecontent .= PHP_EOL;
fwrite($fh,$filecontent);
fclose($fh);
}
$aff = "100";
if (isset($HTTP_RAW_POST_DATA)) {
echo $aff;
WriteLog('events',$aff);
}
Here's the problem: The $aff
variable is not accessible. Echoing the $aff
inside the if ISSET
statement doesn't display the value of the $aff
. What's probably causing this? How can I access the value of the $aff
variable? Note that the WriteLog()
function was executed but the $aff
doesn't have a value. Please help me with this. Thanks!