Prevent Spammer to Register Using The Same Gmail Email (Duplicate User Accounts)

Gmail,  Gmail is …, ah I really don’t need to explain this. So, continue reading The Facts Gmail ignores . (dot) in username If you have Gmail account example@gmail.com, actually you also have ex.ample@gmail.com, exam.ple@gmail.com, and so on until all characters in the username are separated with dot. These all have same inbox, and you can [...]

Creating a WordPress-Alike Hook For Your Own CMS

Probably you have known this, WordPress code is pretty good, especially when compared with other CMS or what we ever found on PHP tutorials. The one I like is how WordPress uses hooks.   If you ever created WordPress plugins, you may experienced that you don’t need to modify any of core code just to add [...]

Searching File Within Directory Recursively Using PHP

Recently I had to find my file stored somewhere in my server. Although I can do this easily using the built-in feature in cPanel File Manager, but what I need is to search file programaticallyusing a script. So, I created this function. The function accepts three parameters: $dir (string), absolute path of the directory to [...]

[PHP] How To Parse Youtube URL to Get Video ID, Thumbnail Image, or Embed Code

Hello, sometime we need to parse Youtube URL to get video ID, thumbnail image, or embed code automatically with PHP. To do so, I have created a function parse_youtube_url(); With this function we can: – Get video ID – Get Embed code – Get Thumbnail or HQ Thumbnail URL Check this out:

jQuery PHP: Facebook Friend Selector Without FBML

Facebook friends selector is one of important thing when you develop a Facebook application. It will simplify the way your visitor select their Facebook friend’s instead of manually find friend’s user ID. Just type part of the friend’s name, the matches name will appears below the field and select one you want. This is not [...]

WordPress Plugin WP Sub Post

WP Sub Post is a wordpress plugin that allow you to make your wordpress post has a parent or child post. Notes: Child post is a real post that has a parent. Child post only displayed on it’s parent post page or when parent page is displayed. Child post can not be viewed individually. Child [...]

PHP: Keep HTML Tags Paired

After applying substr to a string that contains HTML tags, usually I found that the result is broken because the closing tags are truncated. To prevent this, I have made a function that keep the closing tags remains and will not break the appearance of my website. Here is the function: Usage/Example: Feedback and comment [...]

How to fix ‘Function eregi() is deprecated’ in PHP 5.3.0?

I used to use eregi for validating email address input that matches to the regular expression. That would return true if given email address is matches to username@domain.ext pattern. Unfortunately, after upgrading PHP to the earlier version (5.3.0), it wont work properly. This is because eregi is one of several functions that are deprecated in [...]