Banner Ad Rotator Using PHP, Jquery & Ajax

Banner Ads are basically used in Affiliate marketing which may differ based on the services i.e. CPM (Cost per Impression), CPC (Cost per Click) or CPA (Cost per Action) basis which may contain following functionalities as follows :

CPM : Count number of impressions.
CPC : Count number of clicks.
CPA : Count number of successful sales.

Today we will learn how to display random banner rotator using PHP, Jquery & Ajax without any count :

Continue reading “Banner Ad Rotator Using PHP, Jquery & Ajax”

PHP Validation Filters – Avoid Security Vulnerabilities

PHP Validation Filters - Avoid Security Vulnerabilities

Data validation is a very important part of working with forms, because invalid data which you cannot directly control may lead to serious security issues.

As of PHP 5.2.0, we can now use filter functions which are enabled by default to make these filter tasks much easy. There is no installation needed to use these functions.

These PHP filters are used to validate and filter data coming from insecure sources, like user input.
Continue reading “PHP Validation Filters – Avoid Security Vulnerabilities”

Jquery Datatable Plugin Tutorial

Jquery Datatable Plugin Tutorial

Datatables are mainly used to enhance the accessibility of data in HTML tables.

DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool and will add advanced interaction controls to your HTML table like Pagination, instant search and multi-column ordering.

It is very to use Datatable plugin in your HTML pages. Just take a peice of code below: a single function call to initialise the table is all it takes!
Continue reading “Jquery Datatable Plugin Tutorial”

Display Thumbnail Image From Embedded Youtube Video Link

    Once i was working on a website with Youtube embedded videos and i decided rather than actually rendering the video extract a thumbnail image to enhance the page load time, so i thought i should share it to help others.

Applicable Scenario :

Why would you want to download a thumbnail image from a Youtube video? Well, you might want to show it as a feature image for your posts or fro archive purpose or might be for numerous other reasons.

Suppose you have a website where you are displaying numerous Youtube embedded videos, but in this case if you directly render the videos while loading this page, the page load time will increase tremendously so loading images instead of videos will drop down the page load time comparatively and hence improve the performance of your website.

What you need :

You just need to have the Youtube Video ID from your embedded Youtube video link.

Youtube Video :

Display Thumbnail Image From Embedded Youtube Video Link
An embedded Youtube video.

Continue reading “Display Thumbnail Image From Embedded Youtube Video Link”

Build Multi Level Category Using PHP & Mysql

In this tutorial we will create a multi-level nested category menu using PHP and mysql, by calling a recursive function, we can display infinite level of categories and subcategories on the fly, for a drop down box that might look like the following image.
Build Multi Level Category Using PHP & Mysql
Following is the PHP code snippet to build multi-level category using mysql :

Database Structure :

You will need to create a table ‘category’ with 3 columns as follows :
category_id : Primary key for the table.
category_name : Name of the category(level) that will be displayed in the drop down.
parent_id : It is the parent to corresponding category_id. For root category parent_id is 0.