Back To Normal
Click Here To Subscribe Via Email

Subscribe To Our E-Mail Newsletter

Saturday, February 6, 2016

How to Create a Dropdown Menu in HTML with CSS

In this tutorial we will share how to create a simple dropdown navigation or menu bar using HTML and CSS.

Many dropdown menus we tend to see on websites use JavaScript in a way, however it's doable to create one entirely with HTML and CSS. We'll benefit from useful CSS selectors to create a simple dropdown navigation menu.

Read More

Thursday, July 9, 2015

Taking Webpage Screenshots using PHP and PhantomJS

PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.

As the text describes, PhantomJS is a headless browser engine powered by webkit. It can be used for many tasks like, as described by its official website, Headless Website Testing, Screen Capturing (that's what we are gonna do now), Page Automation(♥) and Network Monitoring.

Screen capturing using PhantomJS is really simple; it has been also demonstrated here. But how to do with PHP? Well, that's simple too. Using PHP, we have to execute our script with PhantomJS. That's all. Simple, no?

Capturing Screenshots using PHP

The solution has been already posted by Peter Ivanov on GitHub. But this is not for shared hostings or limited environments as you need to execute PhantomJS server-side (VPS?).

Get Required Files from GitHub

  • Go to
  • Upload all files to your webserver (index.php, shot.php and /bin). For example, to directory: /var/www/html/screen/
  • Make the binary executable using commad: chmod +x /var/www/html/screen/bin/phantomjs
    (You can use latest executable)
  •  Test it by opening your browser and navigating to index.php
  • Read more about the code at GitHub 

Basic Script For Website Screenshot

The above PHP code works by using setting some $vars and then executing the following basic code.

var page = require('webpage').create();'', function() {

Here the file name of the image generated will be 'github.png'. So, this is how it works. Simple code opening and then generating it's screenshot. I would suggest you to dig into the php code above. That's all!

Read More

Tuesday, March 24, 2015

[Free] S4S Script for Facebook Pages

Today, I am just sharing a tiny cool script (which is a $15 value). It's a simple script written in PHP. This is known as S4S (meaning "Share 4 Share") script for facebook pages. It can be used to create short lived posts that can be deleted after the specific amount of time.
Read More

Friday, March 20, 2015

Replacing Multiple Spaces with a Single Space using PHP

This is just a tiny code snippet that I decided to share (may be someone will get help). This is really simple. It just finds and replaces multiple spaces (white-spaces) with a single space.
Read More

Sunday, January 11, 2015

Looping over a JSON array with jQuery

Today, I just thought that it would be useful to share about looping over a JSON array with jQuery. This will be done with the jQuery function, $.each().

Read More

Sunday, January 4, 2015

Store Arrays to MySQL with PHP

This is a simple yet one of the most asked questions that many developers have in their mind. Storing arrays to MySQL should be done only in a very few cases. You should better save your array values in appropriate columns, you should have a good table structure.

However, while it is needed to store whole arrays to MySQL columns in some cases, how you should do it?
Read More

Wednesday, November 19, 2014

Minify HTML, CSS and Javascript on the fly using PHP

Last night, I was optimizing a web-app that is powered by PHP. There was lack of time and many inline javascript and css codes that were needed to be minified.

I decided to use PHP's output buffering for minifying HTML output along with inline javascript and css.  So, i wrote some simple lines of code and it was achieved easily. I thought this code will be useful for many webmasters, so i am sharing it here :)
Read More