Some regular expressions and how to use them in PHP

Thursday, July 28, 2011 | En Español

This isn't a guide about how to create regular expressions (although I would like to make one). These are a few regular expression that I made some time ago, when I had access to a list of names, addresses, phone numbers, etc. They were formatted in very different ways (special the phone numbers) so, the simpler regular expressions that I was using before that, had to be improved. I also talk about to use this regular expressions to validate input fields in PHP scripts.

Read more...

Categories: PHP, Programming

Prepared MySQL statements in PHP (object oriented examples)

Tuesday, July 12, 2011 | En Español

I find sad how many online systems are out there unprotected against even the simplest type of attack, SQL injections. This is a guide and a set of examples about the use of prepared MySQL statements in PHP. If you want to see how an SQL injection attack works you can read the previous article An SQL injection attack. There is a similar guide to this but using the regular structured functions from the MysqlI library at Prepared MySQL statements in PHP (structured examples).

Read more...

Categories: MySQL, PHP, Programming

Prepared MySQL statements in PHP (structured examples)

Tuesday, July 12, 2011 | En Español

I find sad how many online systems are out there unprotected against even the simplest type of attack, SQL injections. This is a guide and a set of examples about the use of prepared MySQL statements in PHP. If you want to see how an SQL injection attack works you can read the previous article An SQL injection attack. There is a similar guide to this but using the object oriented interface of MysqlI in the examples at Prepared MySQL statements in PHP (object oriented examples).

Read more...

Categories: MySQL, PHP, Programming

An SQL injection attack

Tuesday, July 12, 2011 | En Español

Since I wrote two different guides about the use of prepared MySQL statements in PHP, and one of the reasons for use this is to prevent SQL injection attacks, I am going to write a little about these attacks that many websites has suffer and continue to suffer even today. More than define what this attack is, the objective is to show how it works.

Read more...

Categories: MySQL, PHP, Programming

How to create cropped and scaled thumbnails in PHP

Tuesday, September 28, 2010 | En Español

In the previous post, we created scaled thumbnails of images that maintained their aspect ratio. In this post we will see how to crop and scale the image to fill the thumbnail area.

Read more...

Categories: PHP, Programming

How to create scaled thumbnails in PHP

Tuesday, September 28, 2010 | En Español

It's always a good idea to generate as many different sizes of thumbnails as are required in a web based system, right after an image is uploaded. Some of the advantages of generating and storing the thumbnails are that you can reduce the processing time that your server needs to use if you generate the thumbnails on demand, and of course you can reduce the consumed bandwidth by not sending the full size image when this is not necessary.

Read more...

Categories: PHP, Programming