snippets

Make a div stick to top when scrolled to

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

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 »

Cachebuster code in JavaScript

Cachebuster code in JavaScript Read More »

Creating multiple virtual hosts/websites in Wampserver

To create multiple websites, it would be helpful to have each website setup on the local computer. With Wampserver (or just Apache) we can easily configure multiple websites. Following are the steps to create multiple websites using Apache’s configuration. This uses Apache’s “Named Virtual Hosts” configuration. I have tested these steps on Wampserver 2.1 running

Creating multiple virtual hosts/websites in Wampserver Read More »

Voting Functionality in a website

Voting Functionality in a website Read More »