Category: Development

Backing up a file in Windows with a batch script

One part of my job means working with a CMS (content management system) to add some functionality to a site with custom code. Without having source code access this can mean easily breaking things on the backend admin section because the WYSIWYG (what you see is what you get) editor can strip away parts of […]

Automatically list images in a directory with PHP

Sometimes I want to lob some images into a directory to be viewed online for review. There is a way of doing this using glob which is a function in PHP that searches for path names matching patterns according to specified rules. <?php echo(‘<style type=”text/css”> img { margin:3px; padding: 7px; border: 1px solid #aaa; background: […]

Adding canonical URL’s to OpenCart

I wanted to address duplicate content on a project by adding canonical URL’s┬ábecause the product page (e.g.: shares content on some category pages of the same name (e.g.: OpenCart does not allow canonical URL’s by default and although you can buy modules to address this I decided to code my own solution. To […]