would like a new set of eyes on this
Posted: Fri 06 Feb 2015 9:59 pm
Hi I would like another set of eyes to look at this
it not ruining or send a error
http://n9mfk.info/newidea/test.php
it not ruining or send a error
http://n9mfk.info/newidea/test.php
Code: Select all
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
//----------------------------------------------------------------------
// Generate JSON data for the Weather SteelSeries Gauges
// Author: Mark Crossley
//
// Ver 0.1 - 05/01/14 - Initial release, 0.X = a work in progress, breakages and changes on the fly likely!
//----------------------------------------------------------------------
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------
$RealtimeFilename = $_SERVER['DOCUMENT_ROOT'].'/cumuluswebtagsRealtime.php'; // realtime PHP variable file
$CurrentFilename = $_SERVER['DOCUMENT_ROOT'].'/cumuluswebtags.php'; // current PHP variable file
// set up the response headers
header('Cache-Control: private');
header('Cache-Control: no-cache, must-revalidate');
header('Content-type: text/json');
$response = decodeCumulus($CurrentFilename, $RealtimeFilename);
function decodeCumulus($currFile, $RealFile) {
global $response $field1;
// error_reporting(E_ALL);
try {
// incorporate all the Cumulus variables
include($currFile);
include($RealFile);
$field1 = "let see what we get";
return array(array(
$field1
));
} catch (Exception $e) {
return $e->getMessage() . ' line:' . $e->getLine();
}
}
// JSON encode the response
echo json_encode($response), "\n";
// all done!
?>