Development

/Development

strlen and count in PHP5

strlen and count in PHP5 – The Basics If you are new to strlen and/or count in PHP, then you have come to the right place. In this article I will cover the basics you need to understand their uses, and move toward effectively implementing them in your own PHP projects. Both functions are used to count things, however what they count, and how they count them, are completely different. Understanding how they each work by themselves will allow you to use them together to accomplish some very useful things. However, for now, let’s start at the very beginning. […]

By | May 17th, 2011|PHP, PHP, PHP Articles|Comments Off on strlen and count in PHP5

PHP and cURL

Using curl with PHP is incredibly easy. Firstly you’ll need to make sure that you have the PHP curl library installed on your system. On Debian, this is as easy as apt-get install php5-curl Now you can try the following: […]

By | May 17th, 2011|PHP, PHP, PHP Articles|0 Comments

Rebuilding the Robot

It had been a while since I’d worked on the robot, and I wanted to work on some movement algorithms. I’ve done some AI work lately on a separate project, and thought that this would help with the automated movement task. Unfortunately, the Robot had a little accident, namely falling out of the loft whilst I was bring it down. It’s been long overdue the removal of some of the excess hardware, and also needed some bugfixes that I now had no choice but to perform. […]

By | May 1st, 2011|C/C++, Development, Hardware, PHP, Robot, Technology|0 Comments

Another PHP tip

While it’s all well and good to spend considerable time securing your PHP applications, there is something else that you can do, or rather not do. As a PHP programmer, I see people do one alarming thing: they download and install PHP applications from questionable sources. While there are a lot of honourable programmers who offer their scripts for free, there are plenty of hackers who enjoy deploying applications that cause harm to others. I discussed this earlier, but it bears repeating: trust your source. Know your source. […]

By | July 15th, 2010|Development, PHP, PHP, PHP Articles|0 Comments

Validate your input

An important thing to consider when accepting input from users is validation. When PHP is used, powerful functions can be performed. The problem is that it can also do powerful and bad things if a malicious user is entering data which isn’t validated. Consider this: you accept input asking for a month or year. The problem is that a user decides to enter “”;rm -rf *” after the year, and in so doing could cause the deletion of your whole website. Obviously, this is not a good thing, so what to do? Data validation is the answer. As the name suggests, it validates or verifies data, ensuring that it complies to form. […]

By | July 13th, 2010|Development, PHP|0 Comments

The importance of secure PHP code

In recent days, I’ve talked about the importance of server hardening and security, but there’s another aspect of the integrity of your server that must not be ignored: PHP code. If you don’t have secure PHP code, you may find yourself the victim of numerous type of attacks, including SQL injection attacks, which as the name suggest, goes directly after your database, which in most cases is the very heart of your website or application. […]

By | July 12th, 2010|Development, PHP, PHP, PHP Articles|0 Comments

PHP, MySQL and memcached

According to memcached is a distributed object memory caching system. It can be used to set and get data by keys by any application that supports sockets. As a website security consultant I advise you to ensure that your memcache server runs on 127.0.0.1 only and that you secure your server. Anyone with access to the server can telnet to the server’s local interface and get/set your memcache data. I’ve used memcached for a number of PHP/MySQL projects, where I want greater cache control on database queries, than just relying on MySQL’s inbuilt caching abilities. Now, whilst memcached should not be used to mask bad database design and optimization, or badly written SQL queries, it can help dramatically with queries that simply take a long time and have already been optimized as far as possible. Assume that you had a simple database query wrapper: […]

By | June 24th, 2010|Development, MySQL, PHP, PHP, PHP Articles, Technology|0 Comments