Serving WebP with fallback
Posted 5th November 2020
No comments
Two methods to serve WebP images with a fallback for instances where a browser/OS combination doesn’t support it.
PHP file_get_contents over HTTP or HTTPS
Posted 3rd November 2016
No comments
A nifty PHP script which will detect whether a page is being served over HTTP or HTTPS and return the result as a string for use in PHP file_get_contents (or other) include functions.
Adding search to SilverStripe
Posted 3rd January 2015
No comments
Whilst it’s relatively easy to add a site search function to SilverStripe, quite a bit of tweaking is required to make it perform as it should. Here are some simple instructions.
Display WordPress stories and images on a non-WordPress web page
Posted 20th June 2013
3 comments
Step-by-step instructions for including WordPress blog content on non-WordPress static web pages. This method is ideal for advertising ‘latest stories’ on a static website where the article headline, excerpt, date and thumbnail image are to be displayed.
Use PHP to block Pinterest “pins” and still let your site validate
Posted 8th August 2012
No comments
Prevent Pinterest users from “pinning” images on specific web pages or right across your website with this simple PHP include.
Use PHP to ensure a page can only be accessed via a specific URL
Posted 3rd February 2012
3 comments
Use this handy PHP script to redirect visitors who access a web page via an external link or by typing the URL directly into their browser.
Use PHP to insert an automatic “last modified” date into web pages
Posted 30th October 2011
14 comments
Use PHP to generate a “Last modified” date into your static web pages that automatically updates when the page does, so you don’t need to worry about it.
Welcome to ‘code.adonline’
Posted 13th June 2011
No comments
Adam Dimech launches a brand new coding and web development blog.