static and self: weird behaviour or not

Posted on July 01, 2016 at 18:00 PM

Reading the code below, what do you think it will be the output? It has been tested using PHP 5.5.30. error_reporting(E_ALL & ~E_STRICT); class ClassTarget { private static $propertyA = 1; public function getStatic()…

Read More

Comparing variables in PHP

Posted on December 13, 2014 at 00:00 AM

In general it isn't a best practice to compare apples with nuts. But if you really want to do this, you can, but this doesn't mean that you will get the same result as another person would expect to. The same problem…

Read More

isset() && !empty()

Posted on November 24, 2014 at 10:00 AM

When I have found the first time this condition: isset($var) && !empty($var) (that was a few years ago), it put me a little bit to think. It didn't cross my mind to use this condition and I was wondering what…

Read More

How to? - Process a form using PHP (OOP style)

Posted on August 06, 2014 at 13:20 PM

In this post I'll show you how you can transform some procedural code into an OOP code in PHP. What OOP code means? Well, instead of using procedural PHP and some collections of functions (predefined or user-defined),…

Read More

How to? - Process a form using PHP (procedural style)

Posted on July 07, 2014 at 22:40 PM

Today I'll show you how can you use the information that a user sends you using a HTML form. Let's suppose we have a registration form and we want to save the data into a users table with the following structure: id,…

Read More

How to? - My first script using WAMP server and PHP

Posted on June 30, 2014 at 01:00 AM

Because a promise is a promise, here is the first post of a long list on the "PHP - How to?" series. I don't want to scare you so I start with a very easy example: code your first PHP script using PHP and WAMP server.…

Read More

Installing PEAR on WAMP Server

Posted on May 27, 2014 at 08:55 AM

I was curious to see how can I use PEAR packages with a PHP application so I installed PEAR on my WAMP server which was very easy. The hard part was to make it work that's way I'm writting  this post to present you…

Read More

Securing PHP applications Part I – Securing PHP code

Posted on March 20, 2014 at 17:20 PM

There are a lot of books treating this issue. So, why another post about this subject. Well, here a try to cover this problem in a short way so that you don’t have to read hundreds of pages or to search all over the…

Read More

Securing PHP Applications Part II – Securing PHP code

Posted on March 19, 2014 at 01:10 AM

5. SQL injectionsWhat is it? This type of attack is one of the most common attacks. SQL injections occur after two failures of the part of developers: failure to filter data as it enters the application (filter input)…

Read More

Securing PHP Applications Part III – Securing PHP on the server / Securing MySQL and Apache

Posted on March 12, 2014 at 16:00 PM

Hi there. This is the last part of this tutorial where I tell you a few things about securing PHP on the server, about securing MySQL and Apache. OBS: If you don’t administer your own server, this information will…

Read More

Blog Search

Popular Blog Categories


Want to be informed about latest posts? Subscribe to our newsletter