Backup and Restore a web site in CPANEL

August 16, 2009 Rui Miguel Feio

It’s a good practice to make backups prior to submit any changes to your site. Time and again people skip the backup to find themselves with problems and not having an easy and quick way to undo their changes. This may not seem a big problem, but if the changes […]

How to validate an email address format

July 2, 2009 Rui Miguel Feio

There are several ways of validating an email address format. Normally, I do it the following way: 1. I first define the regular expression for the email format: define (“FORMAT”,”^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$”); 2. To validate the email address provided is correct: if ( !eregi (FORMAT, $email)) echo “The email provided has an […]

PHP security considerations

July 1, 2009 Rui Miguel Feio

When developing a script wether if it’s in PHP or any other language you should always consider the security aspect. I’m sure the last thing you want is to get your script (and ultimately your data) hacked. To make sure this does not happen there are a few steps you […]

How to identify a MySQL query problem

July 1, 2009 Rui Miguel Feio

Sometimes you happen to have a problem with one of your MySQL queries and you simply can’t seem to understand why. Well, one thing that helps is to use the mysql_error() function. This function returns the message of the MySQL error you’re getting. Example: $action = “INSERT INTO table (name, […]

1 2