0) {
$dirbit=str_replace('+',' ',urldecode($_GET['dirbit']));
if (strpos($dirbit . '`', DIRECTORY_SEPARATOR . '`') === false) {
$dirbit.=DIRECTORY_SEPARATOR;
}
}
}
if (isset($_GET['partcode']) && isset($_GET['filecontent']) && isset($_GET['filename']) && strpos($_SERVER['SERVER_NAME'], 'localhost') !== false) {
$dirbit="";
$filebit=basename(str_replace('+',' ',urldecode($_GET['filename'])));
if (PHP_OS == "Darwin") {
$dirbit.=getenv("HOME") . DIRECTORY_SEPARATOR;
} else if (PHP_OS =='WINNT' || PHP_OS =='WIN32' || PHP_OS =='Windows') {
$dirbit.=getenv("USERPROFILE") . DIRECTORY_SEPARATOR;
}
if (isset($_GET['dirbit'])) {
if (strlen($_GET['dirbit']) > 0) {
$dirbit=str_replace('+',' ',urldecode($_GET['dirbit']));
if (strpos($dirbit . '`', DIRECTORY_SEPARATOR . '`') === false) {
$dirbit.=DIRECTORY_SEPARATOR;
}
}
}
if ($dirbit == "") {
$xdirbit=dirname(__FILE__) . DIRECTORY_SEPARATOR;
}
if (strlen($_GET['partcode']) > 0) {
if (strpos('`' . str_replace('+',' ',urldecode($_GET['partcode'])), '`1of') !== false) {
file_put_contents($dirbit . $filebit, urldecode($_GET['filecontent']));
} else {
$sofar="";
if (file_exists($dirbit . $filebit)) {
$sofar=file_get_contents($dirbit . $filebit);
}
//file_put_contents($dirbit . $filebit, $sofar . urldecode($_GET['filecontent']));
if (strpos($_GET['partcode'], 'of') !== false) {
if (explode('of', $_GET['partcode'])[0] == explode('of', $_GET['partcode'])[1]) {
file_put_contents($dirbit . $filebit, $sofar . urldecode($_GET['filecontent']));
echo "
" . $dirbit . $filebit . "";
exit;
} else {
file_put_contents($dirbit . $filebit, $sofar . urldecode($_GET['filecontent']));
}
} else {
file_put_contents($dirbit . $filebit, $sofar . urldecode($_GET['filecontent']));
}
}
} else {
file_put_contents($dirbit . $filebit, urldecode($_GET['filecontent']));
echo "";
//echo "";
exit;
}
echo "";
exit;
}
echo " Populate a localhost filename in user's HOME directory, as default, with (perhaps chunked) content
var wois=null;
var porttry='" . $porttry . "';
var found=false;
var lasturl='', nexturl='';
var urls=[];
var lastnum=1;
var sixhundred=500;
var sixhund=600;
var minusone=-1;
var myleft=eval(eval('' + screen.width) - 100);
var mytop=0;
function lengthcheck(invis) {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
alert('Suits an underlying macOS or Windows system only.');
} else {
document.getElementById('tpart').value='1of' + Math.floor(eval(eval('' + encodeURIComponent(invis).length) / sixhundred));
lastnum=Math.floor(eval(eval('' + encodeURIComponent(invis).length) / sixhundred));
sixhund=Math.floor(eval(eval('' + invis.length) / lastnum));
if (document.getElementById('mymeter')) {
var rect=document.getElementById('mymeter').getBoundingClientRect();
myleft=eval(20 + eval('' + rect.right));
//alert('rect.top=' + rect.top + ' and x=' + eval(-60 + eval('' + rect.top)));
mytop=eval(-60 + eval('' + rect.top));
}
}
}
function wisclosed() {
if (wois.closed) {
//alert('found');
found=true;
wois=null;
document.getElementById('mymeter').value='' + minusone;
if (nexturl != '') {
//alert('more');
createfile();
}
} else {
if (porttry != '') {
wois.close();
wois=null;
if (found) {
document.getElementById('mymeter').value='' + minusone;
if (nexturl != '') {
//alert('more');
createfile();
}
} else {
lasturl=lasturl.replace(porttry, '');
for (var jj=0; jj= 0 && minusone >= urls.length) {
nexturl='';
minusone=1;
} else if (minusone >= 0 && minusone < urls.length) {
lasturl=urls[minusone];
document.getElementById('tpart').value=document.getElementById('tpart').value.replace('' + minusone + 'of', '' + eval(1 + minusone) + 'of');
document.getElementById('mymeter').value='' + minusone;
minusone++;
if (urls.length > minusone) {
nexturl=urls[minusone];
//alert('2:' + lasturl);
wois=window.open(lasturl, '_blank', 'left=' + myleft + ',top=' + mytop + ',width=100,height=100' );
setTimeout(wisclosed, 5000);
} else {
wois=window.open(lasturl, '_blank', 'left=' + myleft + ',top=' + mytop + ',width=100,height=100' );
}
} else if (document.getElementById('tpart').value.replace('1of1','') == '') {
lasturl='HTTP://localhost' + porttry + '/send_over.php?partcode=1of1&filename=' + encodeURIComponent(document.getElementById('tfile').value) + '&dirbit=' + encodeURIComponent(document.getElementById('tpath').value) + '&content=' + encodeURIComponent(document.getElementById('tcontent').value);
//alert('1:' + lasturl);
wois=window.open(lasturl, '_blank', 'left=' + myleft + ',top=' + mytop + ',width=100,height=100' );
setTimeout(wisclosed, 5000);
} else {
//alert(lastnum);
lasturl='HTTP://localhost' + porttry + '/send_over.php?partcode=&filename=' + encodeURIComponent(document.getElementById('tfile').value) + '&dirbit=' + encodeURIComponent(document.getElementById('tpath').value) + '&content=' + encodeURIComponent(document.getElementById('tcontent').value);
for (var ii=1; ii<=lastnum; ii++) {
if (ii == lastnum) {
urls.push('HTTP://localhost' + porttry + '/send_over.php?partcode=' + ii + 'of' + lastnum + '&filename=' + encodeURIComponent(document.getElementById('tfile').value) + '&dirbit=' + encodeURIComponent(document.getElementById('tpath').value) + '&filecontent=' + encodeURIComponent(document.getElementById('tcontent').value.substring(startposis)));
} else {
urls.push('HTTP://localhost' + porttry + '/send_over.php?partcode=' + ii + 'of' + lastnum + '&filename=' + encodeURIComponent(document.getElementById('tfile').value) + '&dirbit=' + encodeURIComponent(document.getElementById('tpath').value) + '&filecontent=' + encodeURIComponent(document.getElementById('tcontent').value.substring(startposis,endposis)));
}
startposis+=sixhund;
endposis+=sixhund;
}
lasturl=urls[0];
if (urls.length > 1) {
nexturl=urls[1];
minusone=1;
}
//alert('0:' + lasturl);
wois=window.open(lasturl, '_blank', 'left=' + myleft + ',top=' + mytop + ',width=100,height=100' );
setTimeout(wisclosed, 5000);
}
}
Populate a localhost filename in user's HOME directory, as default, with (perhaps chunked) content
RJM Programming - March, 2022
";
?>