5c5 < // December, 2014 --- > // November, 2014 7,24d6 < $isxml = false; < $fb = ""; < $getacont = ""; < $postacont = ""; < if (isset($_POST['fil'])) { < if ($_POST['fil'] != "") $fb = " ... file=" . $_POST['fil']; < if (strpos($_POST['fil'] . "?", ".xml?") !== false) $isxml = true; < } else if (isset($_GET['fil'])) { < if ($_GET['fil'] != "") $fb = " ... file=" . $_GET['fil']; < if (strpos($_GET['fil'] . "?", ".xml?") !== false) $isxml = true; < } < if (isset($_POST['url'])) { < if (strpos($_POST['url'] . "?", ".xml?") !== false) $isxml = true; < if ($isxml && $_POST['url'] != "") $fb = " ... file=" . $_POST['url']; < } else if (isset($_GET['url'])) { < if (strpos($_GET['url'] . "?", ".xml?") !== false) $isxml = true; < if ($isxml && $_GET['url'] != "") $fb = " ... file=" . $_GET['url']; < } 26,27d7 < $acont = ""; < $cont = ""; 34c14 < $onload = " onload='doonload();' "; --- > $onload = ""; 41,70d20 < if (strpos(strtolower("*" . $url), "*http:") === false && strpos(strtolower("*" . $url), "*https:") === false && strlen($url) > 0) { < if (strpos(strtolower("*" . $url), "*file:") !== false) { < $url = str_replace("file:", "", str_replace("file://", "", $url)); < if (substr($url,0,3) == "../" && strpos(strtolower($_SERVER['SERVER_NAME']), "rjmprogramming.com.au") !== false) { < $jsspec = str_replace("/../", "/", (str_replace("*../", str_replace("//", "/", str_replace("/PHP/", "/", str_replace("/PHP//", "/", str_replace("putElementsBy.php", "", "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . str_replace("?" . $_SERVER['QUERY_STRING'], "", $_SERVER['REQUEST_URI']))))), "*" . $url))); < $url = str_replace("/../", "/", (str_replace("*../", str_replace("//", "/", str_replace("/PHP/", "/", str_replace("/PHP//", "/", (dirname(__FILE__) . "/")))), "*" . $isspec[$ki]))); < } else if (substr($url,0,2) == "./" && strpos(strtolower($_SERVER['SERVER_NAME']), "rjmprogramming.com.au") !== false) { < $jsspec = str_replace("/../", "/", (str_replace("*./", str_replace("//", "/", str_replace("/PHjunkP/", "/", str_replace("/PHjunkP//", "/", str_replace("putElementsBy.php", "", "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . str_replace("?" . $_SERVER['QUERY_STRING'], "", $_SERVER['REQUEST_URI']))))), "*" . $url))); < $url = str_replace("/../", "/", (str_replace("*./", str_replace("//", "/", str_replace("/PHjunkP/", "/", str_replace("/PHjunkP//", "/", (dirname(__FILE__) . "/")))), "*" . $isspec[$ki]))); < } < $fb = " ... file=" . $_GET['url']; < if (strpos($_GET['url'] . "?", ".xml?") !== false) $isxml = true; < $acont = file_get_contents($url); < $cont = str_replace(" = ", "=", $acont); < } else if (file_exists($url)) { < $fb = " ... file=" . $_GET['url']; < if (strpos($_GET['url'] . "?", ".xml?") !== false) $isxml = true; < $acont = file_get_contents($url); < $cont = str_replace(" = ", "=", $acont); < } else { < $acont = $url; //str_replace("\\" . '"', '"', $url); < if ($getacont != "") { < $getacont = $url; < } else { < $postacont = $url; < } < $cont = str_replace(" = ", "=", $acont); < $url = ""; < } < } 73,108d22 < if (strpos(strtolower("*" . $url), "*http:") === false && strpos(strtolower("*" . $url), "*https:") === false && strlen($url) > 0) { < if (strpos(strtolower("*" . $url), "*file:") !== false) { < $url = str_replace("file:", "", str_replace("file://", "", $url)); < if (substr($url,0,3) == "../" && strpos(strtolower($_SERVER['SERVER_NAME']), "rjmprogramming.com.au") !== false) { < $jsspec = str_replace("/../", "/", (str_replace("*../", str_replace("//", "/", str_replace("/PHP/", "/", str_replace("/PHP//", "/", str_replace("putElementsBy.php", "", "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . str_replace("?" . $_SERVER['QUERY_STRING'], "", $_SERVER['REQUEST_URI']))))), "*" . $url))); < $url = str_replace("/../", "/", (str_replace("*../", str_replace("//", "/", str_replace("/PHP/", "/", str_replace("/PHP//", "/", (dirname(__FILE__) . "/")))), "*" . $isspec[$ki]))); < } else if (substr($url,0,2) == "./" && strpos(strtolower($_SERVER['SERVER_NAME']), "rjmprogramming.com.au") !== false) { < $jsspec = str_replace("/../", "/", (str_replace("*./", str_replace("//", "/", str_replace("/PHjunkP/", "/", str_replace("/PHjunkP//", "/", str_replace("putElementsBy.php", "", "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . str_replace("?" . $_SERVER['QUERY_STRING'], "", $_SERVER['REQUEST_URI']))))), "*" . $url))); < $url = str_replace("/../", "/", (str_replace("*./", str_replace("//", "/", str_replace("/PHjunkP/", "/", str_replace("/PHjunkP//", "/", (dirname(__FILE__) . "/")))), "*" . $isspec[$ki]))); < } < $fb = " ... file=" . $_POST['url']; < if (strpos($_POST['url'] . "?", ".xml?") !== false) $isxml = true; < $acont = file_get_contents($url); < $cont = str_replace(" = ", "=", $acont); < } else if (file_exists($url)) { < $fb = " ... file=" . $_POST['url']; < if (strpos($_POST['url'] . "?", ".xml?") !== false) $isxml = true; < $acont = file_get_contents($url); < $cont = str_replace(" = ", "=", $acont); < } else { < $acont = $url; //str_replace("\\" . '"', '"', $url); < if ($getacont != "") { < $getacont = $url; < } else { < $postacont = $url; < } < $cont = str_replace(" = ", "=", $acont); < //echo $cont; < $url = ""; < } < } < } < if (strpos(strtolower($url) . "?", ".xml?") !== false) { < $isxml = true; < $firsttag = "body"; < $bextras = "
"; 118c32 < $onload = " onload='document.getElementById(\"uluu\").innerHTML = document.getElementById(\"uluu\").innerHTML + \"" . $fb . " ... id=\" + \"" . $selid . "\"; preaddele(\"" . $selid . "\",\"id\",\"" . $url . "\");'"; --- > $onload = " onload='document.getElementById(\"uluu\").innerHTML = document.getElementById(\"uluu\").innerHTML + \" ... id=\" + \"" . $selid . "\"; preaddele(\"" . $selid . "\",\"id\",\"" . $url . "\");'"; 129c43 < $onload = " onload='document.getElementById(\"uluu\").innerHTML = document.getElementById(\"uluu\").innerHTML + \"" . $fb . " ... class=\" + \"" . $selclass . "\"; preaddele(\"" . $selclass . "\",\"class\",\"" . $url . "\");'"; --- > $onload = " onload='document.getElementById(\"uluu\").innerHTML = document.getElementById(\"uluu\").innerHTML + \" ... class=\" + \"" . $selclass . "\"; preaddele(\"" . $selclass . "\",\"class\",\"" . $url . "\");'"; 140c54 < $onload = " onload='document.getElementById(\"uluu\").innerHTML = document.getElementById(\"uluu\").innerHTML + \"" . $fb . " ... tag is \" + \"" . $seltag . "\"; preaddele(\"" . $seltag . "\",\"tag\",\"" . $url . "\");'"; --- > $onload = " onload='document.getElementById(\"uluu\").innerHTML = document.getElementById(\"uluu\").innerHTML + \" ... tag is \" + \"" . $seltag . "\"; preaddele(\"" . $seltag . "\",\"tag\",\"" . $url . "\");'"; 147,156c61 < global $url, $getacont, $postacont; < $qurl = $url; < if (isset($_GET['fil'])) { < if ($_GET['fil'] != "") $qurl = $_GET['fil']; < if (strpos($_GET['fil'] . "?", ".xml?") !== false) $isxml = true; < } < if (isset($_POST['fil'])) { < if ($_POST['fil'] != "") $qurl = $_POST['fil']; < if (strpos($_POST['fil'] . "?", ".xml?") !== false) $isxml = true; < } --- > global $url; 158c63 < return "
  Parse file:




... or Url (optional):

" . $stuff . ""; --- > return "
Url (optional):

" . $stuff . ""; 166c71 < $selclass = "
"; --- > $selclass = "
"; 169c74 < $selid = "
"; --- > $selid = "
"; 172c77 < $seltag = "
"; --- > $seltag = "
"; 175a81,82 > $acont = ""; > $cont = ""; 186c93 < if ($url != "" && $cont == "") { --- > if ($url != "") { 189c96 < } else if ($cont == "") { --- > } else { 192,193d98 < } else if ($cont != "") { < $url = ""; 197c102 < if ($url != "" && $cont == "") { --- > if ($url != "") { 200c105 < } else if ($cont == "") { --- > } else { 203,204d107 < } else if ($cont != "") { < $url = ""; 208,226c111,112 < if ($cont == "") { < $acont = file_get_contents($url . "?justlooking="); < $cont = str_replace(" = ", "=", $acont); < } < } < < if (isset($_GET['acont'])) { < if ($_GET['acont'] != "") { < $getacont = urldecode($_GET['acont']); < $acont = $getacont; < $cont = str_replace(" = ", "=", $acont); < } < } else if (isset($_POST['acont'])) { < if ($_POST['acont'] != "") { < $postacont = urldecode($_POST['acont']); < $acont = $postacont; < $cont = str_replace(" = ", "=", $acont); < // file_put_contents(dirname(__FILE__) . "/abba9.xml", "*" . $acont . "*"); < } --- > $acont = file_get_contents($url . "?justlooking="); > $cont = str_replace(" = ", "=", $acont); 228,232c114 < < if ($isxml) $firsttag = "body"; < < < if ($acont != "" || str_replace("http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . str_replace("?" . $_SERVER['QUERY_STRING'], "", $_SERVER['REQUEST_URI']), "", $url) != "") { --- > if (str_replace("http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . str_replace("?" . $_SERVER['QUERY_STRING'], "", $_SERVER['REQUEST_URI']), "", $url) != "") { 245d126 < if ($firsttag == "") { 247,251d127 < } else { < // file_put_contents(dirname(__FILE__) . "/abba1.xml", "*" . $acont . "*"); < $doc->loadXML($acont); < // file_put_contents(dirname(__FILE__) . "/abba2.xml", "*" . $acont . "*"); < } 254d129 < // file_put_contents(dirname(__FILE__) . "/abba3.xml", "*" . $_GET['fil'] . "*" . $_POST['fil'] . "%" . $_GET['url'] . "*" . $_POST['url']); 262d136 < $thing = str_replace("'", "", str_replace("\\", '', str_replace('"', '', $thing))); 302d175 < $thing = str_replace("'", "", str_replace("\\", '', str_replace('"', '', $thing))); 343,344c216,217 < global $tagarray, $seltag, $outtag, $xseltag, $cont, $bextras, $firsttag, $docb, $doc, $isxml; < if (($firsttag != "" || $thing == "body" || $thing == "BODY") && strpos($thing, "/") === false && strpos($thing, "*") === false && strpos($thing, "&") === false && strpos($thing, ";") === false && strpos($thing, "|") === false && strpos($thing, ",") === false && strpos($thing, "{") === false && strpos($thing, "[") === false && strpos($thing, "(") === false && substr($thing, 0, 1) != "/" && substr($thing, 0, 1) != "!") { --- > global $tagarray, $seltag, $outtag, $xseltag, $cont, $bextras, $firsttag, $docb, $doc; > if (($firsttag != "" || $thing == "body" || $thing == "BODY") && strpos($thing, "/") === false && strpos($thing, "*") === false && strpos($thing, "&") === false && strpos($thing, "|") === false && strpos($thing, ",") === false && strpos($thing, "{") === false && strpos($thing, "[") === false && strpos($thing, "(") === false && substr($thing, 0, 1) != "/" && substr($thing, 0, 1) != "!") { 346d218 < // file_put_contents(dirname(__FILE__) . "/aaba.xml", "*" . $thing . "* vs *" . $xseltag . "*"); 350,354d221 < if ($isxml) { < // file_put_contents(dirname(__FILE__) . "/aabb.xml", $thing); < $bextras = str_replace(" ", str_replace("$!bi$!", "", str_replace("@!bi@!", "", str_replace("<", "<", str_replace(">", ">", str_replace("<" . $thing . " ", "@!bi@!<" . $thing . " $!bi$!", str_replace("<" . $thing . ">", "@!bi@!<" . $thing . ">$!bi$!", str_replace("", "@!bi@!</" . $thing . ">$!bi$!", $link->C14N()))))))) . "
", $bextras); < // file_put_contents(dirname(__FILE__) . "/aaab.xml", $bextras); < } else { 356d222 < } 402d267 < // file_put_contents(dirname(__FILE__) . "/abba.xml", "*" . $xxtag[0] . "*"); 404,405c269 < // file_put_contents(dirname(__FILE__) . "/abbb.xml", "*" . $xxtag[0] . "*" . count($items)); < if (count($items) > 0) tagadd($xxtag[0], $xtag[$i - 1], str_replace(">", " ", str_replace("/>", " ", $cont))); --- > if (count($items) > 0) tagadd($xxtag[0], $xid[$i - 1], str_replace(">", " ", str_replace("/>", " ", $cont))); 518d381 < var ww = null; 520,571d382 < var done = 0; < var mycont = ""; < < < function process(infilecontents) { < if (infilecontents != null) { < //alert(document.getElementById('be').innerHTML); < //location.href = "./putElementsBy.php?x=x"; < //document.getElementById("submit").click(); < } < } < < function readBlob(opt_startByte, opt_stopByte) { < < var files = document.getElementById("file").files; < if (!files.length) { < alert("Please select a file!"); < return; < } else { < w = files[0].name; < document.getElementById("fil").value = w; < } < < var file = files[0]; < var start = parseInt(opt_startByte) || 0; < var stop = parseInt(opt_stopByte) || file.size - 1; < < var reader = new FileReader(); < < // If we use onloadend, we need to check the readyState. < reader.onloadend = function(evt) { < if (evt.target.readyState == FileReader.DONE) { // DONE == 2 < //cis = window.open("", "_blank", "top=20,left=20,width=200,height=200"); < //ww = cis; < //cis.document.write(evt.target.result); < document.getElementById("url").value = evt.target.result; < document.getElementById("acont").value = evt.target.result; < document.getElementById("submit").click(); < //cis.document.write(evt.target.result.replace(//g, ">")); < //document.body.innerHTML = document.body.innerHTML + "
" + evt.target.result.replace(//g, ">") + "
"; < document.getElementById("byte_content").textContent = evt.target.result; < document.getElementById("byte_range").textContent = < ["Read bytes: ", start + 1, " - ", stop + 1, < " of ", file.size, " byte file"].join(""); < process(evt.target.result); < } < }; < < var blob = file.slice(start, stop + 1); < reader.readAsBinaryString(blob); < } < 579,600d389 < function doonload() { < if (done == 0) { < < < done = 1; < if (window.File && window.FileReader && window.FileList && window.Blob) { < done = done; < } else { < document.getElementById("file").style.display = "none"; < if (1 == 2) { alert("The File APIs are not fully supported in this browser."); } < } < < document.querySelector('.readBytesButtons').addEventListener('click', function(evt) { < if (evt.target.tagName.toLowerCase() == "button") { < var startByte = evt.target.getAttribute("data-startbyte"); < var endByte = evt.target.getAttribute("data-endbyte"); < readBlob(startByte, endByte); < } < }, false); < } < } < 602,603d390 < doonload(); < 643d429 < 724c510 < if (ww == null) document.getElementById('submit').click(); --- > document.getElementById('submit').click(); 727c513 < if (ww == null) document.getElementById('submit').click(); --- > document.getElementById('submit').click(); 730c516 < if (ww == null) document.getElementById('submit').click(); --- > document.getElementById('submit').click(); 747c533 <

Under line under here are putElement(s)By elements

--- >

Under line under here are putElement(s)By HTML elements