Functionality

Make a div stick to top when scrolled to

There are times when you would want to display a bar at the top of the page when user scrolls on the page and it should go back to its original position when the user scrolls back up. This is particularly useful when you want to add say a share bar, a search bar, etc …

Make a div stick to top when scrolled to Read More »

404 Error Page Best Practices

A 404 error page is the page that the user may reach due to various reasons. Some of the reasons are: The user has entered / spelt the URL incorrectly. The page has been moved or deleted. The URL they clicked on was incomplete or cut in an email or message.

Getting real client IP address in PHP

Many times we need the visitor’s ipaddress for validation, security, spam prevention, etc. Getting the Visitor’s ipaddress is very easy in PHP. The simplest way to get the visitor’s/client’s ipaddress is using the $_SERVER[‘REMOTE_ADDR’] or $_SERVER[‘REMOTE_HOST’] variables. The variable in the $_SERVER array are created by the web server (like apache) and we can use …

Getting real client IP address in PHP Read More »

Voting Functionality in a website

In this post I will give the step by step explanation of how we can add Voting Functionality to a website. At the end of this article we will have a working sample voting application. The source code for the sample voting application can be downloaded from here. We will be using PHP, MySQL, jQuery, …

Voting Functionality in a website Read More »