There always come a time where you need to temporarily stop a site for some required maintenance. The simplest quick&dirty method would be to stop the web server, but it’s not pretty for the users and also it brings down all the sites you are hosting. Another method (which I’ve used in the past) was […]
php
Updating mysql code to mysqli in PHP
There are a few different ways of accessing MySQL from PHP. Historically the mysql extension was the only way until PHP 5.0 (circa 2004). After that mysqli appeared, which is an improved version of the older mysql driver. And also PDO, which gives you an abstraction layer for different databases. Unfortunately there’s still a lot […]
Using the Google Site Verification API in PHP
I wasn’t able to find any tutorial or guide on how to programmatically verify a site for Google, server-side from PHP. What follows is my attempt at doing it. You have to install “Google APIs Client Library for PHP”, available at https://github.com/google/google-api-php-client. I recommend reading the Google documentation on Google Site Verification API from https://developers.google.com/site-verification/v1/getting_started […]
Workaround for gettext caching issue in PHP
gettext is the GNU internationalization and localization (i18n) library, which can be used in almost any programming language. And, of course, it can be used under PHP too, to internationalize your web applications. I will not go into gettext usage details, there are enough resources available for that. Official PHP gettext documentation: http://www.php.net/manual/en/book.gettext.php A nice […]