I want to use a parameter from a separate function, like so:
include("error.php");
include("fnc_uploadImages.php");
//uploadImages = ($imagesTable, $pathImages, $logfile==FALSE)
$fncupload = uploadImages("images","../images/listings","uploadImages.txt");
if($fncupload === TRUE) {
echo "OK";
} else {
echo "NOT OK!";
senderroremail();
}
Where $logfile (in this case, uploadImages.txt) gets sent in an error e-mail via senderroremail().
function uploadImages, contained in fnc_uploadImages.php, declares the following as global:
global $db, $logdir, $logfile, $log, $time, $to, $subject, $msg, $headers;
While senderroremail(), contained in error.php, has the following:
$logdir = "../logs/"; // outside of function in error.php
global $logdir, $logfile, $time;
$log = $logdir . $logfile;
If I echo $log, $logdir is always output, but not $logfile.
How can I reuse the $logfile portion from function uploadImages?