$myFile = "trackers/p.txt"; $fh = fopen($myFile, 'w') or die("Can't open file! You mong"); $w_str = "FW_START\n\nLast read sent time vars\n\nSeconds: " . $st_sec . "\nMinutes: " . $st_min . "\nHours: " . $st_hur . "\nDOW: " . $st_dow . "\nDay: " . $st_day . "\n\nPressure: " . $pressure . "\n\nLight ADC Read: " . $light2 . "\n\nFW_END"; fwrite($fh, $w_str); fclose($fh); $myFile = "trackers/lux.txt"; $fh = fopen($myFile, 'a') or die("Can't open file! You mong"); $w_str = "Photodiode values - ADC: " . $light2 . " - Gain: " . $gain . "\n"; fwrite($fh, $w_str); fclose($fh); // end trackers // now comes the complex error checking stuff // if something goes wrong, we need to know why $errmsg; // init error variable if (!checkVars(&$errmsg)) { $ipv = $_SERVER['REMOTE_ADDR']; $stringData = "The last database record addition rejected was from " . $ipv . " on " . date("F j, Y, G:i") . ".\n\n" . $errmsg; $myFile = "trackers/lr.txt"; $fh = fopen($myFile, 'w') or die("Can't open file! You mong"); fwrite($fh, $stringData); fclose($fh); die("Variable checking failed."); } if ($use_server_time) { $time_f = time(); $one_hour = 60 * 60; if ($daylight_saving) { // apply DST correction if set in config $time_f = $time_f + $one_hour; }
* as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * (see nucleus/documentation/index.html#license for more info) */ /** * @license http://nucleuscms.org/license.txt GNU General Public License * @copyright Copyright (C) 2002-2011 The Nucleus Group * @version $Id: globalfunctions.php 1182 2011-03-21 03:58:23Z sakamocchi $ * $NucleusJP: globalfunctions.php,v 1.23.2.7 2008/02/05 08:30:08 kimitake Exp $ */ // needed if we include globalfunctions from install.php global $nucleus, $CONF, $DIR_LIBS, $DIR_LANG, $manager, $member; $nucleus['version'] = 'v3.64'; $nucleus['codename'] = ''; // check and die if someone is trying to override internal globals (when register_globals turn on) checkVars(array('nucleus', 'CONF', 'DIR_LIBS', 'MYSQL_HOST', 'MYSQL_USER', 'MYSQL_PASSWORD', 'MYSQL_DATABASE', 'DIR_LANG', 'DIR_PLUGINS', 'HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_ENV_VARS', 'HTTP_SESSION_VARS', 'HTTP_POST_FILES', 'HTTP_SERVER_VARS', 'GLOBALS', 'argv', 'argc', '_GET', '_POST', '_COOKIE', '_ENV', '_SESSION', '_SERVER', '_FILES')); $CONF['debug'] = 0; if ($CONF['debug']) { error_reporting(E_ALL); // report all errors! } else { ini_set('display_errors', '0'); error_reporting(E_ERROR | E_WARNING | E_PARSE); } /* * Set default time zone * By Japanese Packaging Team, Jan.27, 2011 * For private server which has no condition for default time zone */ if (function_exists('date_default_timezone_get')) { if (FALSE == ($timezone = @date_default_timezone_get())) {