Archive for May, 2008
E-Mail Address Validator
This function checks if an email address is valid or not. For example it is very useful if you have to validate a html form where someone should enter a real email address.
Read moreGet filename of the currently executing script
Using this piece of code you will get the filename of the currently executing script without containing the full path to it.
For instance if $_SERVER['PHP_SELF'] is equal with /public_html/web/login.php our code will return only login.php
$self = basename($_SERVER['PHP_SELF']);
Read moreHow to remove empty values from an array
This function removes empty values from an array. This is useful if you
Read moreRedirect Visitor
This function will redirect the visitor to a specific location.
<?php
function go($location)
{
header("Location: ".$location);
exit;
}
// Location
$location = ‘http://www.google.com/’;
// Redirect the visitor
go($location);
?>