You are here

iOS Push Notifications with PHP

Introduction Sending notifications to an iOS Application can enhance the experience exponentially for users, also it allows you to deliver key data easily. However, actually sending the push notification to users can be a bit tedious at times, and at times confusing. You need to ensure that you pack your integers, and times correctly – failing to do this and you’ll probably get an unhelpful status from Apple. The APNS Using the APNS (Apple Push Notification Service) requires a bit of pre-configuration initially, you’ll need to download some certificates from…

Read More

PHP Password Hashing

Introduction Previously we’ve discussed how you can go about storing your passwords if you’re using PHP, and the best way to hash them. However, with more recent versions of PHP (5.5+), there are some actual methods included in the core language that you should use instead. These will take out a lot of the trouble that you might have working out the best way to create a salt, or how to ensure that you’re doing it correctly. Best of all, it’s native too – so if you’re able to I…

Read More

Branch Subdomains with Git & Nginx

Introduction When developing applications using source control it’s always advisable to use different branches for features, or bug fixes. Especially if you follow the GitFlow paradigm, which stipulates that you have a develop, and master branch at the very least, with master being what is in production currently. One of the problems with distributed development among teams is how to actually stage these development branches, which might have super cool features that you want to demo to people, without destroying your main staging environment. Instead, it’d be pretty swell to…

Read More

Getting Started with Go

Introduction Sometimes referred to as ‘Golang’, Go has been around for a while now – with regular updates and a strong development push currently underway to change how the core of the compiler works. No need to dwell on that. There are many benefits of using Go, two of the many are: No dependencies You can compile the code into the binary for your operating system, and then run it – there is no need to preinstall anything on your server like with PHP, or Ruby. Concurrency You can quickly,…

Read More

PHP GD Introduction

Introduction As part of this multi-part tutorial we’re going to look at how we can write a basic graphing library using the PHP GD library. While a lot of graphing libraries exist in JavaScript, there have been situations where I’ve required a PHP graphing library, but failed to find one that has done what I needed. For example when including graphs in a server-side generated PDF, or if you want to give users the option to download/export graphs as images from a web application. We’ll be doing a very simple…

Read More

Adding Jobs to the Crontab

Introduction Utilising something called the crontab, we can schedule jobs, or cronjobs, to run at a set time or date. Really useful for things like updating a cache of data, or sending out tweets announcing a random – it is used on the Codular servers for that reason. How? With some hosting providers, you may find yourself provided with a nice clean GUI through which you can select intervals, and commands to execute. If this is what you have, it’s probably best to use that. However, if you don’t have…

Read More

PDO: A How To

Introduction We’ve already looked at MySQLi, and now we’re going to have a look at the PDO class. PDO stands for PHP Data Objects and is described as a “lightweight, consistent interface for accessing databases in PHP”. Although it’s name isn’t that great, PDO is a lovely way of accessing your database in PHP. Differences with MySQLi MySQLi and PDO are very alike, except for two major differences: While MySQLi only works with MySQL, PDO works with 12 different Databases PDO does not have a procedural fallback (mysqli_* functions) Getting…

Read More

JS AJAX File Upload with Progress

Introduction Nowadays, people love doing things without leaving the page they’re viewing, this is mostly done using AJAX. Many times people use jQuery to make it easier, but with the advances in browsers, there’s no real need for this. Here we’ll be looking at how to upload a file to the server without leaving the page, we’ll be using the same backend PHP code that was used in one of our earlier articles. The script will upload a file to the server, show a progress bar highlighting how much has…

Read More

Storing Passwords with PHP

Introduction Chances are that you have a password to something, and that password is probably also stored somewhere. Chances are, if you’re a web developer, you’ve probably wondered how best to store a password for your users to later use when logging into your website. Plain text? MD5? SHA1? Bacon substituted (this doesn’t exist)?. All of these are foolish ways to store a password, especially the last one, I don’t even know what that is. You should be using bcrypt to store your passwords, if you’re not – well you…

Read More