- <?
- function getOnOff() {
- return fgets($handle);
- }
- function maintenanceCheck ()
- {
- // open the onoff switch and have a look
- $handle = fopen("onoff.php", "r");
- $onoff = getOnOff();
- if (!feof($handle)) {
- echo "<P>Error: unexpected fgets() fail\n";
- }
- fclose($handle);
- echo "<P>after fclose common fns onoff says $onoff";
- $result = $onoff;
- return $result;
- }