sponsor

Wednesday, October 31, 2007

What is favicon.cio

Favicon is the acronym for ‘Favorites Icon’. The small image displayed at the beginning of the URL bar or address bar of browser is known as the Favicon. That icon is nothing but the small symbol of the whole web page or the site and thus is also known as the pageicon or urlicon.

Creating favicon.ico :
1. Create an image of 16×16 pixels.
2. Save that image as ‘favicon.ico’ .

Placing or Uploading favicon.ico :
Favicon.ico file must be uploaded under the root directory of the web server so that it is automatically displayed on the address bar. And if the favicon.ico is not uploaded in the root directory the developer will have to specify a tag in section of the web page for locating that icon.

<link rel=”shortcut icon” xhref=”/favicon.ico” type=”image/x-icon” />
For XHTML, the link element must be terminated by ” />” instead of “>”.
Give specific path to href attribute so that the favicon.ico will get located.

Most of the browsers available read the faicon.ico file format correctly and thus easily displays the icon in the URL bar. However, now some browsers also support animated GIF and PNG image formats. Older versions of IE dont display this favicon; but now the newer versions support favicons.

Advantages and Limitations of favicon.ico :
The important advantage of using favicon is to make your Favorites entry easier to find. But Favicon also has limitations. Only newer versions of IE shows icon in the Favorites listings as well as in the address bar. While netscape and opera use it only in the address bar and not in the bookmarks list. Also, the icon disappears when the browser cache is emptied.

Friday, October 26, 2007

Fungsi PHP untuk menghitung umur

Umur seseorang dihitung berdasarkan perbedaan tanggal lahirnya dengan tanggal sekarang. Kali ini saya akan memberikan fungsi PHP untuk menghitung umur.


//sebuah function dengan nama hitUmur dan sebuah parameter
function hitUmur($tgllahir) {
$tgl = explode("-", $tgllahir);
// memecah $tgllahir yang tadinya YYYY-MM-DD menjadi array
// $tgl[0] = tahun (YYYY)
// $tgl[a] = bulan (MM)
// $tgl[2] = hari (DD)

$umur = date("Y") - $tgl[0]; //ini untuk ngitung umurnya

if(($tgl[1] > date("m")) || ($tgl[1] == date("m") && date("d") < $tgl[2])) //ngecek apakah tgl lahir dan bulannya belum lewat?
{

$umur -= 1;
}
return $umur;
}

//cara mengakses fungsi
$tgllahirku = "1980-10-12";
echo hitUmur($tgllahirku);
?>

Wednesday, October 3, 2007

Instalasi PHP, APACHE, MYSQL

bagi anda yang mau instalasi php, apache dan mysql satu-persatu. Bisa diwonload tutorialnya di sini. Tutorial berbentuk file swf....
1. Untuk instalasi di Windows, http://www.megaupload.com/?d=28V56YG8
2. Untuk instalasi di Linux, http://www.megaupload.com/?d=OGGHZH6S

Semoga tutorial di atas dapat membantu.....