0) { echo " replacewith = prompt('Please supply " . $comma . " character Mathematical operator string (no spaces please) for your calculations out of + - * / & | ^ ~ % (and will allow << >> >>> for other shift operators, if last to do) ', '" . substr($def, 0, $comma) . "'); " . "\n"; } } if (!$isn && !isset($_GET['leaveinquotes'])) { return ""; } return $outl; } if (!isset($_GET['infile'])) { echo "" . "" . " var inf=prompt('Please enter Mathematical input filename or URL full of lines like 45*34/56= or CSV lines like 45,34,56',''); if (inf.length > 1) window.location = './eval_js_php.php?infile=' + inf; " . " \n"; } if (isset($_GET['infile'])) { $getinfile = $_GET['infile']; $httphuh = strpos($getinfile, "http"); $filehuh = strpos($getinfile, "file:"); if ($httphuh !== false || $filehuh !== false) { $myc = file_get_contents($getinfile); $fh = fopen("youllneverbelieve.this", "w"); fwrite($fh, $myc); fclose($fh); $getinfile = "youllneverbelieve.this"; } if (!file_exists($getinfile)) { die("Please use syntax like eval_js_php.php" . "?infile=aninfile.txt&interactive=y&leaveinquote=y&justanswer=n with entries like 6 * 5 / 4= (where the file name really exists)"); } else { $lines = file($getinfile); if ($getinfile == "youllneverbelieve.this") { unlink("youllneverbelieve.this"); } $top200 = array_slice($lines,0,200); echo "" . "" . " " . "\n"; ?> var replacewith = ''; function anal(inf,way) { var outf = inf; var j; if (replacewith != '') { outf = ''; var readInStrings = inf.split(/,/); outf = readInStrings[0]; for (var i=1; i < readInStrings.length; i++) { j = i; if ((i+1) == readInStrings.length) { j = replacewith.length; } outf = outf + replacewith.substring((i - 1), j) + readInStrings[i]; } if (way == 1) { //alert(inf + " vs " + outf + " via " + replacewith); outf = eval(outf); } else if (way < 0) { outf = ""; } else { outf = outf + "="; } } return outf; } " . str_replace("\n", "", analyze($line)) . $a . "


'); "; } else { //eval('$a='.str_replace("\n", "", str_replace("=", "", analyze($line))).';'); echo "xb.innerHTML = xb.innerHTML + anal('

" . str_replace("\n", "", analyze($line)) . "',0) + anal('" . str_replace("\n", "", analyze($line)) . "',1) + '


'; "; } } } echo "
" . "\n"; } } else { die("Please use syntax like eval_js_php.php" . "?infile=aninfile.txt&interactive=y&leaveinquote=y&justanswer=n with entries like 6 * 5 / 4="); } ?>