Senin, 18 Oktober 2021

.htaccess Pewaktuan

 





.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?path=$1 [NC,L,QSA]

index.php
<html>
<head>
<script type="text/javascript">
function Ajax(){
var $http,$self = arguments.callee;

if (window.XMLHttpRequest) {$http = new XMLHttpRequest();} 
else if (window.ActiveXObject) {
try {$http = new ActiveXObject('Msxml2.XMLHTTP');} 
catch(e) {$http = new ActiveXObject('Microsoft.XMLHTTP');}
}

if ($http) {
$http.onreadystatechange = function(){
if (/4|^complete$/.test($http.readyState)) {
document.getElementById('ReloadThis').innerHTML = $http.responseText;
setTimeout(function(){$self();}, 1000);
}
};
$http.open('GET', 'timer.php' + '?' + new Date().getTime(), true);
$http.send(null);
}
}
</script>
<script type="text/javascript">setTimeout(function() {Ajax();}, 1000);</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php

$url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$ar=explode("/",$url);
$jd=count($ar);
$nama= $ar[$jd-1];
$nama=str_replace("+"," ",$nama);
$nama=str_replace("-"," ",$nama);
$nama=str_replace("%20"," ",$nama);
echo "<h1>Yth, $nama</h1>";
?>

</body>
</html>

timer.php
<?php
date_default_timezone_set("Asia/Jakarta");

$tglacara="2025-12-25";
$jamacara="00:00:00";

$tglnow=date("Y-m-d");
$jamnow=date("H:m:s");

$acara = new DateTime($tglacara." ".$jamacara);
$sekarang = new DateTime();


$tanggal=WKT($tglnow);
echo  "<b>MEETING :".WKT($tglacara)."</b><br>";
echo  "<b>TODAY :$tanggal $jamnow Wib</b>";

$diff  = date_diff( $acara,$sekarang );
echo"<hr>";
echo $diff->y . " tahun<br>";
echo $diff->m . " bulan<br>";
echo $diff->d . " hari<br>";
echo $diff->h . " jam<br>";
echo $diff->i . " menit<br>";
echo $diff->s . " detik<br>";

?>










<?php
function WKT($sekarang){
$tanggal = substr($sekarang,8,2)+0;
$bulan = substr($sekarang,5,2);
$tahun = substr($sekarang,0,4);

$judul_bln=array(1=> "Januari", "Februari", "Maret", "April", "Mei","Juni", "Juli", "Agustus", "September","Oktober", "November", "Desember");
$wk=$tanggal." ".$judul_bln[(int)$bulan]." ".$tahun;
return $wk;
}
?>








Tidak ada komentar:

Posting Komentar

global_priv WARNING Selalu

 Jika muncul pesan kesalahan: Warning in .\libraries\classes\Dbal\DbiMysqli.php#209  mysqli::query(): (HY000/1034): Index for table 'glo...