Membuat kalender dengan php

sebelumnya instal dulu xampp, klo xamppnya udah di install sekarang buka editor web yang ada di PC lo... kalo ga ada pake notepad aja bisa kok..terus copy-paste script dibawah

<?php
echo("
<table>
<td background='img/bg_kalender.png' width='99' height='108'> ");
$n_hari=array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu");
$n_bulan=array("Januari","Februari","Maret","April","Mei","Juni","Juli","
Agustus","September","Oktober","November","Desember");
$hari=$n_hari[date("w",time())];
$tanggal=date("d",time());
$bulan=$n_bulan[date("m",time())-1];
$tahun=date("Y",time());

echo "<center><font size='2' color=white>$hari</font><br>";
echo "<font size='6' color=white>$tanggal<br></font>";
echo "<font size='1' color=white>$bulan";
echo " $tahun</center></font>";
echo ("
</td>
</table>
");
?>

simpan dengan nama "kalender.php"
misal lo install xampp di drive "C:\xampp\"
maka lo harus menyimpan filenya di "C:\xampp\htdocs\kalender.php"
oh iya.. untuk gambar backgroudnya jangan lupa kasih nama "bg_kalender.png",
kemudian simpan satu folder dengan file "kalender.php"

screen shoot :


kalo udah sekarang buka browser kalian, pada url ketik "http://localhost/kalender.php" [tanpa tanda kutip ya..]

*gudluck

2 comments:

  1. kog ndak bisa ya mas .,,..



    Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Krasnoyarsk' for '7.0/no DST' instead in C:\xampp\htdocs\kalender.php on line 10

    Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Krasnoyarsk' for '7.0/no DST' instead in C:\xampp\htdocs\kalender.php on line 11

    Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Krasnoyarsk' for '7.0/no DST' instead in C:\xampp\htdocs\kalender.php on line 12

    Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Krasnoyarsk' for '7.0/no DST' instead in C:\xampp\htdocs\kalender.php on line 13
    Rabu
    11
    Mei 2011

    ReplyDelete
  2. thanks... it's work...

    ReplyDelete