I dont know where exactly I am going wrong here. I have narrowed the problem down to $file not being set to anything and I do not know where I have gone wrong. Please help :)
Code: ($_GET['unit'] is 1)
$filepathhalf = "http://sureclean.netai.net/data/";
$date = date("Ymd");
$unitnum = $_GET['unit'];
$ext = ".txt";
$filepath = $filepathhalf.$unitnum.$date.$ext;
$bool = file_exists($filepath);
if($bool = true)
{
$fh = fopen($filepath, 'r');
$file = fread($fh, 4);
fclose($fh);
}
else{};
$file = strval($file);
echo $file;
yourwebsite/data/120120714.txt:
true