SMTP Email Address Validation

How do you validate an email address? You may validate it with a javascript on the client-side, or run a server-side validation via a regular expression or a newly available filter_var function of the PHP 5.2.x. Perhaps, you may want to go one step further and verify the email address from the remote SMTP server.

Malware detected on website

One of the servers we manage has been compromised, and hosting malware according to Kaspersky Anti-Virus software. The site uses a number of open-source applications such as WordPress, Gnuboard, and phpLinkDirectory. We initially thought it would be either the .htaccess or base64_encode exploit, but after close examination, we found that a plain javascript snippet was inserted into one of the Gnuboard include files (bbs/visit_insert.inc.php).

What is the difference between "Primary Key" and "Unique Key" in SQL?

I've had a chance to with a Postgres database and came across a table with two primary keys. This intrigues me to look up a definition of primary and unique key. I always thought there would only be one primary key in a table, and the values have to be unique. But, what I saw in the PostgreSQL v8.1.23 was something otherwise. It allowed duplicate entries, and also allowed multiple primary keys in a table. Is this possible? Yes, it's called composite Primary Keys. Composite primary keys (multiple primary keys) makeup uniqueness in a table row -- which means composite primary keys work together to provide uniqueness.

Zend Framework without MVC

The reasoning for using a framework such as Zend Framework (ZF for short) is to speed up the development process, make the application extensible, and make use of the design patterns such as MVC. I think MVC is great, it separates the models, views, and controllers and makes the entire development process very clean. If MVC is great, why would you use Zend Framework without MVC?

Perl string quotation operators (q, qq, qr and qx)

In scripting programming languages such as Perl, PHP, and Python use string quotation extensively. To include a single or double quote inside the string quotation, you'll have to escape the character with a backslash. Perl string quotation operators (q, qq and qx) let you avoid putting too many backslashes into quoted strings.

Multiple Constructors in PHP

In most object-oriented programming languages such as Java, C++, and C#, you can define multiple constructors each having different signatures. The class calls the correct constructor based on the number of parameters, and data type of input parameters. In PHP5, however, you can have one and only one constructor. Constructor in PHP is defined with a reserved keyword, __construct(). If the __construct function doesn’t exist, PHP5 will search for the old-style constructor function by the name of the class.

Javascript Overview

JavaScript is an object-oriented scripting language designed to be embedded in HTML pages for added interactivity and to offer intelligence to web pages. JavaScript provides a set of objects (Array, Date, and Math), and language elements (Operators, Conditional Controls, and Statements). Javascript is primarily used on the client side to control the browser elements and HTML Document Object Model (DOM) to offer interactivity to users.