Selamat aidil fitri
Kepada saudara serta saudari
Setahun hanya sekali
Merayakan hari yang mulia ini
Di masa bulan Ramadan
Kita berpuasa hingga sebulan
Pabila Syawal menjelma
Hari raya disambut dengan gembira
(Korus 1)
Miskin kaya memakai baju baru warna-warni
Mengunjungi sanak kaum famili
Sungguh hebat pemandangan di hari raya ini
Tua muda wajah berseri-seri
Selamat hari raya
Pada saudari saudara semua
Marilah dengan gembira
Merayakan aidilfitri yang mulia
Di sana kelihatan
Bermacam kuih ketupat dan rendang
[ Saloma Lyrics are found on www.songlyrics.com ]
Mintak bu kuih sepotong
Saya mahu makan kerna perut kosong
Dam dam dum bunyi mercun
Kanak-kanak segera datang berduyun
Dam dam dum mercun berdentum
Semaraklah hari raya ini tahun
(Korus 2)
Maafkanlah jika ada terlanjur perkataan
Diharap supaya jangan disimpan
Kuberdoa selamat panjang umur murah rezeki
Semoga Tuhan akan memberkati
Selamat hari raya
Hari untuk kita bersuka ria
Selamat mari ucapkan
Untuk kita hingga sampai tahun depan
Selamat hari raya!
Sorry, something went wrong.
12:28 AM
Sorry, something went wrong.
NEW YORK (PIX11) - Facebook users were shut out of their accounts after the social networking site went down Friday morning.
The failure didn’t affect everyone however, some were still able to access the site. Others received the cryptic message “Sorry, something went wrong.”
It is still unclear if Facebook went down as the result of a malicious attack.
Facebook had not posted anything on their Twitter feed about the problem as of 12:20 p.m.
Tingkat atas rumah Ku Nan terbakar
2:59 PMTingkat atas rumah Ku Nan terbakar
Kebakaran teruk memusnahkan aras empat rumah Tengku Adnan Tengku Mansor di Jalan Duta, Kuala Lumpur, semalam. - Utusan/RASHID MAHFOF
|
KUALA LUMPUR 8 Mei - Tingkat atas rumah empat tingkat milik Setiausaha Agung UMNO, Datuk Seri Tengku Adnan Tengku Mansor di Jalan Duta 5, Taman Duta di sini musnah dalam kebakaran yang berlaku awal pagi ini.
Kebakaran di rumah itu yang didiami oleh Tengku Adnan sejak 25 tahun dipercayai bermula dari bilik anak lelakinya, Tengku Mohd. Faiz, 15, pada pukul 5.30 pagi berikutan kerosakan sistem pendingin hawa.
Menurut beliau, berlaku percikan api dari pendingin hawa itu ketika anaknya sedang tidur menyebabkan dia bingkas bangun dan mengejutkan semua ahli keluarganya yang sedang tidur.
"Ketika kejadian, terdapat 16 orang di dalam rumah ini termasuk ahli keluarga dan lima pembantu rumah. Saya segera mengejutkan mereka semua supaya keluar dari rumah sebelum menghubungi bomba.
"Tingkat empat rumah yang menempatkan tiga bilik tidur, ruang tamu, dapur dan ruang makan musnah 100 peratus," katanya ketika ditemui di tempat kejadian, di sini hari ini.
Tengku Adnan yang juga Ahli Parlimen Putrajaya sepatutnya menghadiri majlis perasmian hafalan al-Quran kanak-anak di Putrajaya hari ini memberitahu, beliau tidak menyangka kejadian sedemikian menimpa keluarganya berikutan pendingin hawa tersebut baru sahaja dipasang di bilik anaknya itu petang semalam.
"Saya dan keluarga reda dengan kejadian ini dan akan berpindah ke kediaman di Impiana Tunku, Kenny Hills sementara kerja baik pulih dijalankan," katanya.
Beliau dan ahli keluarganya berjaya menyelamatkan sebahagian barang-barang peribadi termasuk peti besi yang terletak di aras empat tersebut.
Dalam pada itu, Ketua Balai Bomba dan Penyelamat Daerah Sentul, Halim Mustafar berkata, seramai 46 anggota bersama enam jentera dari Balai Hang Tuah, Sentul, Sri Hartamas dan Jinjang serta Jabatan Forensik dikerahkan ke lokasi kejadian selepas menerima maklumat kira-kira pukul 6 pagi.
"Api merebak dengan cepat berikutan dinding bangunan diperbuat daripada kayu yang mudah terbakar.
"Pihak forensik masih menyiasat punca sebenar kejadian dan anggaran kerugian," katanya.
PHP Stopping E-mail Injections
2:04 PM
<html>
<body>
<?php
function spamcheck($field)
{
// Sanitize e-mail address
$field=filter_var($field, FILTER_SANITIZE_EMAIL);
// Validate e-mail address
if(filter_var($field, FILTER_VALIDATE_EMAIL))
{
return TRUE;
}
else
{
return FALSE;
}
}
?>
<h2>Feedback Form</h2>
<?php
// display form if user has not clicked submit
if (!isset($_POST["submit"]))
{
?>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
From: <input type="text" name="from"><br>
Subject: <input type="text" name="subject"><br>
Message: <textarea rows="10" cols="40" name="message"></textarea><br>
<input type="submit" name="submit" value="Submit Feedback">
</form>
<?php
}
else
// the user has submitted the form
{
// Check if the "from" input field is filled out
if (isset($_POST["from"]))
{
// Check if "from" email address is valid
$mailcheck = spamcheck($_POST["from"]);
if ($mailcheck==FALSE)
{
echo "Invalid input";
}
else
{
$from = $_POST["from"]; // sender
$subject = $_POST["subject"];
$message = $_POST["message"];
// message lines should not exceed 70 characters (PHP rule), so wrap it
$message = wordwrap($message, 70);
// send mail
mail("webmaster@example.com",$subject,$message,"From: $from\n");
echo "Thank you for sending us feedback";
}
}
}
?>
</body>
</html>
<body>
<?php
function spamcheck($field)
{
// Sanitize e-mail address
$field=filter_var($field, FILTER_SANITIZE_EMAIL);
// Validate e-mail address
if(filter_var($field, FILTER_VALIDATE_EMAIL))
{
return TRUE;
}
else
{
return FALSE;
}
}
?>
<h2>Feedback Form</h2>
<?php
// display form if user has not clicked submit
if (!isset($_POST["submit"]))
{
?>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
From: <input type="text" name="from"><br>
Subject: <input type="text" name="subject"><br>
Message: <textarea rows="10" cols="40" name="message"></textarea><br>
<input type="submit" name="submit" value="Submit Feedback">
</form>
<?php
}
else
// the user has submitted the form
{
// Check if the "from" input field is filled out
if (isset($_POST["from"]))
{
// Check if "from" email address is valid
$mailcheck = spamcheck($_POST["from"]);
if ($mailcheck==FALSE)
{
echo "Invalid input";
}
else
{
$from = $_POST["from"]; // sender
$subject = $_POST["subject"];
$message = $_POST["message"];
// message lines should not exceed 70 characters (PHP rule), so wrap it
$message = wordwrap($message, 70);
// send mail
mail("webmaster@example.com",$subject,$message,"From: $from\n");
echo "Thank you for sending us feedback";
}
}
}
?>
</body>
</html>
Example Explained - The HTML Page ( Ajax Form)
1:59 PM
<html>
<head>
<script>
function showHint(str)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML="";
return;
}
var xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","gethint.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<p><b>Start typing a name in the input field below:</b></p>
<form>
First name: <input type="text" onkeyup="showHint(this.value)">
</form>
<p>Suggestions: <span id="txtHint"></span></p>
</body>
</html>
save as ajax_form.html
=======================================================
<?php
// Fill up array with names
$a[]="Anna";
$a[]="Brittany";
$a[]="Cinderella";
$a[]="Diana";
$a[]="Eva";
$a[]="Fiona";
$a[]="Gunda";
$a[]="Hege";
$a[]="Inga";
$a[]="Johanna";
$a[]="Kitty";
$a[]="Linda";
$a[]="Nina";
$a[]="Ophelia";
$a[]="Petunia";
$a[]="Amanda";
$a[]="Raquel";
$a[]="Cindy";
$a[]="Doris";
$a[]="Eve";
$a[]="Evita";
$a[]="Sunniva";
$a[]="Tove";
$a[]="Unni";
$a[]="Violet";
$a[]="Liza";
$a[]="Elizabeth";
$a[]="Ellen";
$a[]="Wenche";
$a[]="Vicky";
// get the q parameter from URL
$q=$_REQUEST["q"]; $hint="";
// lookup all hints from array if $q is different from ""
if ($q !== "")
{ $q=strtolower($q); $len=strlen($q);
foreach($a as $name)
{ if (stristr($q, substr($name,0,$len)))
{ if ($hint==="")
{ $hint=$name; }
else
{ $hint .= ", $name"; }
}
}
}
// Output "no suggestion" if no hint were found
// or output the correct values
echo $hint==="" ? "no suggestion" : $hint;
?>
save as gethint.php
=================================================
<head>
<script>
function showHint(str)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML="";
return;
}
var xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","gethint.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<p><b>Start typing a name in the input field below:</b></p>
<form>
First name: <input type="text" onkeyup="showHint(this.value)">
</form>
<p>Suggestions: <span id="txtHint"></span></p>
</body>
</html>
save as ajax_form.html
=======================================================
<?php
// Fill up array with names
$a[]="Anna";
$a[]="Brittany";
$a[]="Cinderella";
$a[]="Diana";
$a[]="Eva";
$a[]="Fiona";
$a[]="Gunda";
$a[]="Hege";
$a[]="Inga";
$a[]="Johanna";
$a[]="Kitty";
$a[]="Linda";
$a[]="Nina";
$a[]="Ophelia";
$a[]="Petunia";
$a[]="Amanda";
$a[]="Raquel";
$a[]="Cindy";
$a[]="Doris";
$a[]="Eve";
$a[]="Evita";
$a[]="Sunniva";
$a[]="Tove";
$a[]="Unni";
$a[]="Violet";
$a[]="Liza";
$a[]="Elizabeth";
$a[]="Ellen";
$a[]="Wenche";
$a[]="Vicky";
// get the q parameter from URL
$q=$_REQUEST["q"]; $hint="";
// lookup all hints from array if $q is different from ""
if ($q !== "")
{ $q=strtolower($q); $len=strlen($q);
foreach($a as $name)
{ if (stristr($q, substr($name,0,$len)))
{ if ($hint==="")
{ $hint=$name; }
else
{ $hint .= ", $name"; }
}
}
}
// Output "no suggestion" if no hint were found
// or output the correct values
echo $hint==="" ? "no suggestion" : $hint;
?>
save as gethint.php
=================================================
Create an Upload-File Form
1:52 PM
=================================================
<html>
<body>
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
save as upload_form.php
=================================================
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br>";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br>";
echo "Type: " . $_FILES["file"]["type"] . "<br>";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>
save as upload_file.php
================================================
<html>
<body>
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
save as upload_form.php
=================================================
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br>";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br>";
echo "Type: " . $_FILES["file"]["type"] . "<br>";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>
save as upload_file.php
================================================
PHP 5 Array Functions
1:46 PM| Function | Description |
|---|---|
| array() | Creates an array |
| array_change_key_case() | Changes all keys in an array to lowercase or uppercase |
| array_chunk() | Splits an array into chunks of arrays |
| array_column() | Returns the values from a single column in the input array |
| array_combine() | Creates an array by using the elements from one "keys" array and one "values" array |
| array_count_values() | Counts all the values of an array |
| array_diff() | Compare arrays, and returns the differences (compare values only) |
| array_diff_assoc() | Compare arrays, and returns the differences (compare keys and values) |
| array_diff_key() | Compare arrays, and returns the differences (compare keys only) |
| array_diff_uassoc() | Compare arrays, and returns the differences (compare keys and values, using a user-defined key comparison function) |
| array_diff_ukey() | Compare arrays, and returns the differences (compare keys only, using a user-defined key comparison function) |
| array_fill() | Fills an array with values |
| array_fill_keys() | Fills an array with values, specifying keys |
| array_filter() | Filters the values of an array using a callback function |
| array_flip() | Flips/Exchanges all keys with their associated values in an array |
| array_intersect() | Compare arrays, and returns the matches (compare values only) |
| array_intersect_assoc() | Compare arrays and returns the matches (compare keys and values) |
| array_intersect_key() | Compare arrays, and returns the matches (compare keys only) |
| array_intersect_uassoc() | Compare arrays, and returns the matches (compare keys and values, using a user-defined key comparison function) |
| array_intersect_ukey() | Compare arrays, and returns the matches (compare keys only, using a user-defined key comparison function) |
| array_key_exists() | Checks if the specified key exists in the array |
| array_keys() | Returns all the keys of an array |
| array_map() | Sends each value of an array to a user-made function, which returns new values |
| array_merge() | Merges one or more arrays into one array |
| array_merge_recursive() | Merges one or more arrays into one array recursively |
| array_multisort() | Sorts multiple or multi-dimensional arrays |
| array_pad() | Inserts a specified number of items, with a specified value, to an array |
| array_pop() | Deletes the last element of an array |
| array_product() | Calculates the product of the values in an array |
| array_push() | Inserts one or more elements to the end of an array |
| array_rand() | Returns one or more random keys from an array |
| array_reduce() | Returns an array as a string, using a user-defined function |
| array_replace() | Replaces the values of the first array with the values from following arrays |
| array_replace_recursive() | Replaces the values of the first array with the values from following arrays recursively |
| array_reverse() | Returns an array in the reverse order |
| array_search() | Searches an array for a given value and returns the key |
| array_shift() | Removes the first element from an array, and returns the value of the removed element |
| array_slice() | Returns selected parts of an array |
| array_splice() | Removes and replaces specified elements of an array |
| array_sum() | Returns the sum of the values in an array |
| array_udiff() | Compare arrays, and returns the differences (compare values only, using a user-defined key comparison function) |
| array_udiff_assoc() | Compare arrays, and returns the differences (compare keys and values, using a built-in function to compare the keys and a user-defined function to compare the values) |
| array_udiff_uassoc() | Compare arrays, and returns the differences (compare keys and values, using two user-defined key comparison functions) |
| array_uintersect() | Compare arrays, and returns the matches (compare values only, using a user-defined key comparison function) |
| array_uintersect_assoc() | Compare arrays, and returns the matches (compare keys and values, using a built-in function to compare the keys and a user-defined function to compare the values) |
| array_uintersect_uassoc() | Compare arrays, and returns the matches (compare keys and values, using two user-defined key comparison functions) |
| array_unique() | Removes duplicate values from an array |
| array_unshift() | Adds one or more elements to the beginning of an array |
| array_values() | Returns all the values of an array |
| array_walk() | Applies a user function to every member of an array |
| array_walk_recursive() | Applies a user function recursively to every member of an array |
| arsort() | Sorts an associative array in descending order, according to the value |
| asort() | Sorts an associative array in ascending order, according to the value |
| compact() | Create array containing variables and their values |
| count() | Returns the number of elements in an array |
| current() | Returns the current element in an array |
| each() | Returns the current key and value pair from an array |
| end() | Sets the internal pointer of an array to its last element |
| extract() | Imports variables into the current symbol table from an array |
| in_array() | Checks if a specified value exists in an array |
| key() | Fetches a key from an array |
| krsort() | Sorts an associative array in descending order, according to the key |
| ksort() | Sorts an associative array in ascending order, according to the key |
| list() | Assigns variables as if they were an array |
| natcasesort() | Sorts an array using a case insensitive "natural order" algorithm |
| natsort() | Sorts an array using a "natural order" algorithm |
| next() | Advance the internal array pointer of an array |
| pos() | Alias of current() |
| prev() | Rewinds the internal array pointer |
| range() | Creates an array containing a range of elements |
| reset() | Sets the internal pointer of an array to its first element |
| rsort() | Sorts an indexed array in descending order |
| shuffle() | Shuffles an array |
| sizeof() | Alias of count() |
| sort() | Sorts an indexed array in ascending order |
| uasort() | Sorts an array by values using a user-defined comparison function |
| uksort() | Sorts an array by keys using a user-defined comparison function |
| usort() | Sorts an array using a user-defined comparison function |