/"; for ($k=0; $k", "tag=" . $stuff[$k] . "'>" . $stuff[$k] . "", $outp); $outp = $inp; } } return str_replace("", "", $outp); } if (!isset($_GET['look'])) { header("Location: " . $_SERVER['REQUEST_URI'] . "?look=POST&tableid=[id]&tableth=[label]&tdbasis=[v]"); } if (isset($_GET['look']) || 1 == 1) { // analyze posted data $sru = str_replace("?" . $_SERVER['QUERY_STRING'], "", $_SERVER['REQUEST_URI']); $done = ""; $htmlis = "RJM Programming Blog GETME Summary - September, 2014 "; $numcols = 0; $thiscols = 0; $rowdat = ""; if ($_GET['look'] == "POST" || 1 == 1) { $idbasis = "[id]"; if (isset($_GET['tableid'])) { $idbasis = $_GET['tableid']; } $thbasis = "[label]"; if (isset($_GET['tableth'])) { $thbasis = $_GET['tableth']; } $tdbasis = "[v]"; if (isset($_GET['tabletd'])) { $tdbasis = $_GET['tabletd']; } // Create table of downloadable code at RJM Programming Wordpress blog ... http://www.rjmprogramming.com.au/wordpress // RJM Programming - September, 2014 // Date FileLink Path Extension DiffLinkAsApplicable WordpressSearchLink exec("find " . dirname(__FILE__) . "/ -name '*GETME' | sort > /tmp/basegetmelist.is 2> /dev/null"); $overall = file_get_contents("/tmp/basegetmelist.is"); $arroverall = explode("\n", $overall); $htmlis = str_replace("", "
", $htmlis); $rowdattemplate = ""; $qarr = array("Date (GMT)", "File", "Path off " . str_replace($_SERVER['DOCUMENT_ROOT'], "http://" . $_SERVER['HTTP_HOST'], dirname(__FILE__)) . "/", "Extension", "Blog Search Link", "Code Difference Link"); foreach ($qarr as &$qvalue) { if (str_replace("", "", $htmlis) == $htmlis) $htmlis = str_replace("", "", $htmlis); $htmlis = str_replace("", "" . $qvalue . "", $htmlis); $numcols++; $rowdattemplate = str_replace("", "" . $numcols . "", $rowdattemplate); } date_default_timezone_set('England/London'); $dsuff = "?datetime=" . date ("Ymd.His"); $t = 1; for ($i=0; $i1", ">" . date ("Ymd.His", filemtime($arroverall[$i])) . "", $rowdat); $rowdat = str_replace(">2", ">" . "" . $myfile . "", $rowdat); $rowdat = str_replace(">3", ">" . breadcrumbed($mypath) . "", $rowdat); $rowdat = str_replace(">4", ">" . $myext . "", $rowdat); if (strpos($_SERVER['HTTP_HOST'], "rjmprogramming.com.au") !== false) { $rowdat = str_replace(">5", ">" . "" . $fil[sizeof($fil) - 1] . "", $rowdat); if (strpos($arroverall[$i], "--GETME") !== false || strpos($arroverall[$i], "__GETME") !== false || strpos($arroverall[$i], "-GETME") !== false || strpos($arroverall[$i], "_GETME") === false) { if (!file_exists(str_replace("-" , "_", str_replace("__" , "_", $arroverall[$i]))) && str_replace("-" , "_", str_replace("__" , "_", $arroverall[$i])) != $arroverall[$i]) { $rowdat = str_replace(">6", ">", $rowdat); } else { $rowdat = str_replace(">6", ">" . "" . $fil[sizeof($fil) - 1] . "", $rowdat); } } else { $rowdat = str_replace(">6", ">", $rowdat); } } else { $rowdat = str_replace(">5", ">", $rowdat); $rowdat = str_replace(">6", ">", $rowdat); } $htmlis = str_replace("", $rowdat . "", $htmlis); } } $htmlis = str_replace("", "
Back
", $htmlis); } else { // analyze get data $htmlis = "

"; foreach($_GET as $key=>$value) { if ($key != "look") $htmlis = str_replace("

", str_replace("-", "[", str_replace("_", "]", $key)).'='.$value."

", $htmlis); } $htmlis = str_replace("", "
Back
", $htmlis); } if (str_replace(".php", ".htm", $_SERVER['SCRIPT_FILENAME']) != $_SERVER['SCRIPT_FILENAME']) { file_put_contents(str_replace(".php", ".htm", $_SERVER['SCRIPT_FILENAME']), $htmlis); header("Location: " . str_replace($_SERVER['DOCUMENT_ROOT'], "http://" . $_SERVER['HTTP_HOST'], str_replace(".php", ".htm", $_SERVER['SCRIPT_FILENAME'])) . $dsuff); } else { echo $htmlis; } } else if (99 == 999) { // analyze input json data $prejd = "?look=GET&"; $jd = ""; $fu = ""; if (isset($_GET['feedurl'])) { $fu = $_GET['feedurl']; } else if (isset($_POST['feedurl'])) { $fu = $_POST['feedurl']; } if (isset($_GET['jsondatais'])) { $jd = $_GET['jsondatais']; if ($jd == "" && isset($_GET['feedurl'])) { if ($_GET['feedurl'] != "") $jd = str_replace(");", "", str_replace("google.visualization.Query.setResponse(", "", file_get_contents($_GET['feedurl']))); } } else if (isset($_POST['jsondatais'])) { $prejd = ""; $jd = $_POST['jsondatais']; if ($jd == "" && isset($_POST['feedurl'])) { if ($_POST['feedurl'] != "") $jd = str_replace(");", "", str_replace("google.visualization.Query.setResponse(", "", file_get_contents($_POST['feedurl']))); } } if (isset($_GET['ask'])) { $sru = str_replace("?" . $_SERVER['QUERY_STRING'], "", $_SERVER['REQUEST_URI']); $htmlis = "

JSON Data Criteria


"; $htmlis = str_replace("
", "\n
JSON Array data

", $htmlis); $htmlis = str_replace("
", "\n
", $htmlis); $htmlis = str_replace("
", "\n

or JSON Feed url

", $htmlis); $htmlis = str_replace("
", "\n


Table ID searchspec
", $htmlis); $htmlis = str_replace("
", "\n

Table Heading searchspec
", $htmlis); $htmlis = str_replace("
", "\n

Table Cell searchspec

", $htmlis); echo $htmlis; } else if ($jd != "" && $prejd != "") { $sru = str_replace("?" . $_SERVER['QUERY_STRING'], "", $_SERVER['REQUEST_URI']); $json = urldecode($jd); // eg. '{"a":1,"b":2,"c":3,"d":4,"e":5}'; //echo $json; try { if (strpos($jd, "\\") !== false) { $server_query = str_replace('{', '', str_replace('}', '', str_replace("'", "", str_replace('"', '', str_replace(',"', '&', str_replace('":', '=', str_replace("\\", "", $json))))))); } else { $objarr = json_decode($json); $server_query = http_build_query($objarr); } } catch (Exception $e) { $server_query = str_replace('{', '', str_replace('}', '', str_replace("'", "", str_replace('"', '', str_replace(',"', '&', str_replace('":', '=', str_replace("\\", "", $json))))))); } //echo $server_query; if ($server_query != "") { $url = $sru . $prejd . $server_query; header("Location: " . $url); } else { $hj = substr($jd, 1, (strlen($jd) - 2)); $json = urldecode($hj); // eg. '{"a":1,"b":2,"c":3,"d":4,"e":5}'; try { if (strpos($hj, "\\") !== false) { $server_query = str_replace('{', '', str_replace('}', '', str_replace("'", "", str_replace('"', '', str_replace(',"', '&', str_replace('":', '=', str_replace("\\", "", $json))))))); } else { $objarr = json_decode($json); $server_query = http_build_query($objarr); } } catch (Exception $e) { $server_query = str_replace('{', '', str_replace('}', '', str_replace("'", "", str_replace('"', '', str_replace(',"', '&', str_replace('":', '=', str_replace("\\", "", $json))))))); } if ($server_query != "") { $url = $sru . "?look=GET&" . $server_query; //echo $hj . " to " . $json . " and then " . $url; header("Location: " . $url); } else { echo "Your JSON data is malformed"; } } } else if (1 == 1) { // else ... post our default scenario $urlis = "http://www.rjmprogramming.com.au/PHP/ChartEditor/chart_editor_in.php?infile=Google_Chart_Intensity_Chart_Tutorial_as.CSV"; if (isset($_GET['feedurl'])) { $urlis = $_GET['feedurl']; } else if (isset($_POST['feedurl'])) { $urlis = $_POST['feedurl']; } $idbasis = "[id]"; if (isset($_GET['tableid'])) { $idbasis = $_GET['tableid']; } else if (isset($_POST['tableid'])) { $idbasis = $_POST['tableid']; } $thbasis = "[label]"; if (isset($_GET['tableth'])) { $thbasis = $_GET['tableth']; } else if (isset($_POST['tableth'])) { $thbasis = $_POST['tableth']; } $tdbasis = "[v]"; if (isset($_GET['tabletd'])) { $tdbasis = $_GET['tabletd']; } else if (isset($_POST['tabletd'])) { $tdbasis = $_POST['tabletd']; } if ($prejd == "") { //$tdbasis .= "&jsondatais=" . $jd; $json = $jd; if ($fu == "") header("Location: " . $_SERVER['REQUEST_URI'] . "?jsondatais=" . $jd); } else { $json = str_replace(");", "", str_replace("google.visualization.Query.setResponse(", "", file_get_contents($urlis))); //http://www.datatables.net/examples/ajax/data/arrays.txt"); } $htmlis = "

"; //echo $json; // try { // if (strpos($json, "\\") !== false && 1 == 2) { // $server_query = str_replace('{', '', str_replace('}', '', str_replace("'", "", str_replace('"', '', str_replace(',"', '&', str_replace('":', '=', str_replace("\\", "", $json))))))); // $htmlis = str_replace("
", "\n
", $htmlis); // } else { //echo $json; $objarr = json_decode(str_replace("\\", "", $json)); $server_query = http_build_query($objarr); // } // } catch (Exception $e) { // $server_query = str_replace('{', '', str_replace('}', '', str_replace("'", "", str_replace('"', '', str_replace(',"', '&', str_replace('":', '=', str_replace("\\", "", $json))))))); // } // version=0.6&status=ok&sig=&table=cols=[id=A&label=Country&type=string&pattern=,id=B&label=Population&type=number&pattern=#0.###############,id=C&label=Crude Birth Rate&type=number&pattern=#0.###############]&rows=[c=[v=China,v=1347000000&f=1347000000,v=12&f=12],c=[v=India,v=1241000000&f=1241000000,v=22&f=22],c=[v=United States,v=312000000&f=312000000,v=14&f=14],c=[v=Indonesia,v=238000000&f=238000000,v=18&f=18],c=[v=Brazil,v=197000000&f=197000000,v=15&f=15],c=[v=Pakistan,v=177000000&f=177000000,v=27&f=27],c=[v=Nigeria,v=162000000&f=162000000,v=40&f=40],c=[v=Bangladesh,v=151000000&f=151000000,v=20&f=20],c=[v=Russia,v=143000000&f=143000000,v=13&f=13],c=[v=Japan,v=128000000&f=128000000,v=8&f=8],c=[v=Mexico,v=115000000&f=115000000,v=19&f=19],c=[v=Philippines,v=96000000&f=96000000,v=25&f=25],c=[v=Vietnam,v=88000000&f=88000000,v=16&f=16],c=[v=Ethiopia,v=87000000&f=87000000,v=31&f=31],c=[v=Germany,v=81800000&f=81800000,v=8&f=8],c=[v=Egypt,v=82600000&f=82600000,v=23&f=23],c=[v=Iran,v=78000000&f=78000000,v=17&f=17],c=[v=Turkey,v=74000000&f=74000000,v=18&f=18],c=[v=Thailand,v=69500000&f=69500000,v=12&f=12],c=[v=Congo,v=67800000&f=67800000,v=43&f=43],c=[v=France,v=63300000&f=63300000,v=13&f=13],c=[v=United Kingdom,v=62700000&f=62700000,v=13&f=13],c=[v=Italy,v=60800000&f=60800000,v=9&f=9]] //$objarr = json_decode($json); //$server_query = http_build_query($objarr); $ds = urldecode($server_query); $ads = explode("&", $ds); for ($i=0; $i", "\n
", $htmlis); } echo $htmlis; } } ?>