7,58d6
< $line='';
< $numargs=-1;
< $gxml="";
< $pxml="";
< $ziparr = array();
<
< function outin($inh) {
< global $numargs;
< if ($numargs <= 0) {
< return $inh;
< } else {
< $huhr='';
< $wo=false;
< $inh=str_replace("","\n",str_replace("
","\n",str_replace("","\n",str_replace("
","\n",$inh))));
< for ($iu=0; $iu') {
< $wo=true;
< } else if (substr($inh, $iu, 1) == '<') {
< $wo=false;
< } else if ($wo) {
< $huhr.=substr($inh, $iu, 1);
< }
< }
< return $huhr;
< }
< }
<
< if (isset($_GET['xml'])) { // surfing the net
< $gxml=$_GET['xml'];
< } else if (isset($_POST['xml'])) { // surfing the net
< $pxml=$_POST['xml'];
< } else if (isset($argv)) { // command line
< $numargs = sizeof($argv);
< if ($numargs <= 1) {
< if (PHP_OS == 'WINNT') {
< echo '$ XML File(spec) or URL: ';
< $line = stream_get_line(STDIN, 1024, PHP_EOL);
< } else {
< $line = readline('$ XML File(spec) or URL: ');
< }
< $gxml=urlencode($line);
< } else {
< $gxml=$argv[1];
< array_push($ziparr, $argv[1]);
< for ($iu=2; $iu<$numargs; $iu++) {
< $gxml.=' ' . $argv[$iu];
< array_push($ziparr, $argv[$iu]);
< }
< $gxml=urlencode($gxml);
< }
< }
<
112c60
< if ($gxml != "") {
---
> if (isset($_GET['xml'])) {
114,124c62,64
< if (strpos(str_replace("+"," ",urldecode($gxml)), " ") !== false || strpos(str_replace("+"," ",urldecode($gxml)), "*") !== false || strpos(str_replace("+"," ",urldecode($gxml)), "%") !== false || strpos(str_replace("+"," ",urldecode($gxml)), "?") !== false) {
< $htmlis="XML to CSV " . $jobbits . " Report Run ...
";
< if (strpos(str_replace("+"," ",urldecode($gxml)), " ") !== false) {
< $inths=str_replace(" ",",",str_replace("+"," ",urldecode($gxml))); //$ziparr;
< } else {
< $inths=str_replace("+"," ",urldecode($gxml));
< }
< $intha=explode(",", $inths);
< for ($ii=0; $ii if (strpos(str_replace("+"," ",urldecode($_GET['xml'])), "*") !== false || strpos(str_replace("+"," ",urldecode($_GET['xml'])), "%") !== false || strpos(str_replace("+"," ",urldecode($_GET['xml'])), "?") !== false) {
> $htmlis="XML to CSV " . $jobbits . " Report Run ...
";
> foreach (glob(str_replace("+"," ",urldecode($_GET['xml']))) as $xmlfil) {
138,140d77
< if ($numargs >= 1) {
< exec("php " . $argv[0] . ' "' . $xmlfil . '"');
< } else {
142d78
< }
149,150c85
< }
< echo outin($htmlis);
---
> echo $htmlis;
154,156c89,91
< if (strpos(strtolower("~" . urldecode($gxml)), "~http") !== false) {
< $xmlstr=file_get_contents(urldecode($gxml));
< $outidea=explode("." . explode(".",urldecode($gxml))[-1 + sizeof(explode(".",urldecode($gxml)))], urldecode($gxml))[0];
---
> if (strpos(strtolower("~" . urldecode($_GET['xml'])), "~http") !== false) {
> $xmlstr=file_get_contents(urldecode($_GET['xml']));
> $outidea=explode("." . explode(".",urldecode($_GET['xml']))[-1 + sizeof(explode(".",urldecode($_GET['xml'])))], urldecode($_GET['xml']))[0];
160,161c95,96
< } else if (strpos(strtolower("~" . urldecode($gxml)), "~<") !== false) {
< $xmlstr=str_replace("+"," ",urldecode($gxml));
---
> } else if (strpos(strtolower("~" . urldecode($_GET['xml'])), "~<") !== false) {
> $xmlstr=str_replace("+"," ",urldecode($_GET['xml']));
165c100
< } else if (file_exists(urldecode($gxml))) {
---
> } else if (file_exists(urldecode($_GET['xml']))) {
167c102
< $outidea=explode("." . explode(".",urldecode($gxml))[-1 + sizeof(explode(".",urldecode($gxml)))], urldecode($gxml))[0];
---
> $outidea=explode("." . explode(".",urldecode($_GET['xml']))[-1 + sizeof(explode(".",urldecode($_GET['xml'])))], urldecode($_GET['xml']))[0];
171c106
< $xml = oursimplexml_load_file(urldecode($gxml));
---
> $xml = oursimplexml_load_file(urldecode($_GET['xml']));
173c108
< } else if ($pxml != '') {
---
> } else if (isset($_POST['xml'])) {
175c110
< if (strpos(str_replace("+"," ",urldecode($pxml)), "*") !== false || strpos(str_replace("+"," ",urldecode($pxml)), "%") !== false || strpos(str_replace("+"," ",urldecode($pxml)), "?") !== false) {
---
> if (strpos(str_replace("+"," ",urldecode($_POST['xml'])), "*") !== false || strpos(str_replace("+"," ",urldecode($_POST['xml'])), "%") !== false || strpos(str_replace("+"," ",urldecode($_POST['xml'])), "?") !== false) {
177,185c112
< if (strpos(str_replace("+"," ",urldecode($pxml)), " ") !== false) {
< $inths=str_replace(" ",",",str_replace("+"," ",urldecode($gxml))); //$ziparr;
< } else {
< $inths=str_replace("+"," ",urldecode($pxml));
< }
< $intha=explode(",", $inths);
< for ($ii=0; $ii foreach (glob(str_replace("+"," ",urldecode($_POST['xml']))) as $xmlfil) {
199,201d125
< if ($numargs >= 1) {
< exec("php " . $argv[0] . ' "' . $xmlfil . '"');
< } else {
203d126
< }
210d132
< }
215,217c137,139
< if (strpos(strtolower("~" . urldecode($pxml)), "~http") !== false) {
< $xmlstr=file_get_contents(urldecode($pxml));
< $outidea=explode("." . explode(".",urldecode($pxml))[-1 + sizeof(explode(".",urldecode($pxml)))], urldecode($pxml))[0];
---
> if (strpos(strtolower("~" . urldecode($_POST['xml'])), "~http") !== false) {
> $xmlstr=file_get_contents(urldecode($_POST['xml']));
> $outidea=explode("." . explode(".",urldecode($_POST['xml']))[-1 + sizeof(explode(".",urldecode($_POST['xml'])))], urldecode($_POST['xml']))[0];
221,222c143,144
< } else if (strpos(strtolower("~" . urldecode($pxml)), "~<") !== false) {
< $xmlstr=str_replace("+"," ",urldecode($pxml));
---
> } else if (strpos(strtolower("~" . urldecode($_POST['xml'])), "~<") !== false) {
> $xmlstr=str_replace("+"," ",urldecode($_POST['xml']));
226c148
< } else if (file_exists(urldecode($pxml))) {
---
> } else if (file_exists(urldecode($_POST['xml']))) {
228c150
< $outidea=explode("." . explode(".",urldecode($pxml))[-1 + sizeof(explode(".",urldecode($pxml)))], urldecode($pxml))[0];
---
> $outidea=explode("." . explode(".",urldecode($_POST['xml']))[-1 + sizeof(explode(".",urldecode($_POST['xml'])))], urldecode($_POST['xml']))[0];
232c154
< $xml = oursimplexml_load_file(urldecode($pxml));
---
> $xml = oursimplexml_load_file(urldecode($_POST['xml']));
259c181
< echo outin("XML to CSV " . $jobbits . " Report - RJM Programming - September, 2018
---
> echo "XML to CSV " . $jobbits . " Report - RJM Programming - September, 2018
267c189
< ");
---
>