Archive for the ‘PHP’ Category

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

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 be useful to you while shopping for a Web host, so you better continue reading.
Before starting this [...]

Securing PHP Applications Part II – Securing PHP code

5. SQL injections
What 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) and failure to escape data as it is sent to the database (escape output). For example, let’s suppose we [...]

Design patterns Part IV – MVC

The problem:
When your php application became larger, you might find yourself in the situation where you don’t know where to change the design of a certain page, or you might have to change in multiple places to get the same results.
For example, if you want to implement a comments system in your application, you could [...]

Securing PHP applications Part I – Securing PHP code

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 Internet for this.
These being said, you must know that securing a [...]

Design Pattern Part III – Observer

The problem:
Well, this is my favorite. Why? Because get you free of a lot of responsabilities. Let me explain: suppose you have an online newspaper website and for publishing an article you must follow these steps:
1. write the article
2. insert the article in the proper table in your database
3. delete the cache (an necessary operation for the article [...]

Design Patterns Part II – Factory

The problem:
We need a method that could generate us different “products” based on different conditions or, why not, depending on the context. If we didn’t know about design patterns we would solve this by creating an endless if then else set of conditions. I know, this is the fastest solution that comes into your head, [...]

SWF image upload & crop for php using jQuery

Recently I’ve needed a plugin to upload an image using SWF upload and to crop the uploaded image using jQuery and then  save the crop result. I couldn’t find this combination, so I’ve tried to combine these requests: SWF upload, crop with jQuery and php.
I’ve found something about SWF upload here and something about jQuery [...]

Capturing multiple thumbnails from a movie using ffmpeg

When working with video processing scripts, a common requirement is to create thumbnails from a video. Fortunately, with ffmpeg we can make still captures from a a video, and i will show you 2 of the methods in this article.

Bandwidth limit script

Sometimes you want to limit the bandwidth for certain ips or sites, in order to keep your traffic within limits, or to keep constant bandwidth to all users, regardless of how much they are downloading.
Here is a solution to do that:

Common php errors and how to debug them

A lot of questions asked by beginners are about errors errors that occur when running a PHP script. In the following article, I will try to summarize these errors, hoping to be useful to those who, like me when I’ve started coding in PHP,met with such problems.