Web Development

Posts related to Web Development

Generating bcrypt .htpasswd passwords using PHP

In my previous post we saw how to generate .htpasswd file using crypt and apr1-md5 algorithm in PHP. However, now there is a more secure BCRYPT algorithm that can be used since apache 2.4 for passwords in .htpasswd. In this post we will generate .htpasswd file using the BCRYPT algorithm in PHP.

How to remove render blocking JavaScript with defer and async

With HTML5 there are 2 new boolean attributes for <script> tag which indicates to the browser how the script should be evaluated. The 2 attributes are defer and async. Using these attributes can help improve the page load time by downloading the script in parallel when the page is being parsed and then executing it …

How to remove render blocking JavaScript with defer and async Read More »

How to sort a multi-dimension array by value in PHP

In this article we will see how to sort a multi-dimension array by value of one of the keys of the array. We can use a few different methods to do this. One way to to use usort() function. Another way is to just identify the values and create another array with the values and …

How to sort a multi-dimension array by value in PHP Read More »

Protocol relative URLs

Many times we have seen warnings similar to “This page contains both secure and nonsecure items” or “This page has insecure content.”. This happens when we are viewing a HTTPS site and some content on the site is loaded from HTTP. So when we try to view a site say https://www.example.com and we get this …

Protocol relative URLs Read More »

Understanding favicon

A favicon (short for “favorites icon”) is a small image associated with a website intended to be used when you bookmark a page. Web browsers also use them in the URL bar, on tabs, etc to help the users identify a website. It is typically a 16×16 pixels square icon which is saved as favicon.ico in the root directory of the website’s server.