title: PHP not reading file?
body: <p>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 :) </p>
  
  <p>Code: ($_GET['unit'] is 1)</p>
  
  <pre><code>                $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;
  </code></pre>
  
  <p>yourwebsite/data/120120714.txt:</p>
  
  <pre><code>true
  </code></pre>