Kamis, 22 Oktober 2020
Rabu, 07 Oktober 2020
Upload file using VB.NET and PHP
VB COde
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Using wc As New System.Net.WebClient()
wc.UploadFile("http://apps.pastioke.com/info.php", "x:\wa.php")
End Using
End Sub
PHP CODE
<?
if($_FILES){
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
$txt = print_r($_FILES, true);
$target_file = 'ff.txt';
move_uploaded_file($_FILES["file"]["tmp_name"], $target_file);
fwrite($myfile, $txt);
$txt = print_r($_GET);
fwrite($myfile, $txt);
fclose($myfile);
}
?>
s
Minggu, 04 Oktober 2020
Little Javascript Trick
Move Document to End (Scroll to end)
window.scrollTo(0,document.body.scrollHeight);
Rabu, 30 September 2020
Javascript event listener on all class
const divs = document.querySelectorAll('.hitung');
or
const divs = document.querySelector('button[type="submit"]');
divs.forEach(el => el.addEventListener('keyup', event => {
var fm=el.form;
fm['a[harga1]'].value=fm["a[bruto]"].value - (fm["a[diskon1]"].value * fm["a[bruto]"].value / 100);
fm['a[harga2]'].value=fm["a[harga1]"].value - (fm["a[diskon2]"].value * fm["a[harga1]"].value / 100);
fm['a[harga3]'].value=fm["a[harga2]"].value - (fm["a[diskon3]"].value * fm["a[harga2]"].value / 100);
fm['a[harga]'].value=fm['a[harga3]'].value;
event.preventDefault();
//console.log(event.target.classList[1]);
}));
Minggu, 27 September 2020
Ajax JSON to fill form
form to display data
code to load data
code to display
Minggu, 13 September 2020
PHP Menghitung sisa waktu mengerjakan CBT
$mulai=explode(":",$logtugas->jammulai)[0]*3600 + explode(":",$logtugas->jammulai)[1]*60 + explode(":",$logtugas->jammulai)[2]*1;
$sekarang=date("H")*3600 + date("i")*60 + date("s")*1;
$akhir=$mulai*1 + ($logtugas->durasi*60) ;
$sisawaktu=$akhir*1 - $sekarang*1;
Senin, 07 September 2020
Let's encrypt Wilcard ssl on Centos 7
yum install epel-release
yum install yum-utils
yum install python2-certbot-apache
yum install python2-certbot-nginx
certbot certonly --manual -d *.easyware.id -d easyware.id --agree-tos --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory
certbot certonly --manual -d *.pastioke.com --agree-tos --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory --register-unsafely-without-email
key
/etc/letsencrypt/live/easyware.id/privkey.pem
cert atas // CA bundle bawah
/etc/letsencrypt/live/easyware.id/fullchain.pem