Victor's Blog about PHP, Zend Framework & Cake PHP

This blog is about PHP in general. It tackles various topics related to the language itself especially at the OOP level, discusses various topics related to Zend Framework and shares my experience with Cake PHP. I believe that mastering technology is heavily based on one's ability to discuss its details and share knowledge with others. Technology is a wide wild world after all!

How-To Validate / Sanitize Data in PHP

Printable Version

victor | 07 December, 2012 08:50

In this post, I will tackle a very important (and usually ignored topic) when programming in PHP.

Data validation and sanitization is not only important at the business level, but also very important at the security level since this is where most attacks usually take place especially when dealing with SQL injection and Cross-Site Scripting attacks.


How-To Set the Time to be Synchronized in CentOS / Linux?

Printable Version

victor | 03 December, 2012 12:27

First, we will install NTP Daemon which will keep the server time in sync continuously.

yum install ntp
chkconfig ntpd on

Then, we will set the time for the first time from the command prompt.

Then, we will start the NTP daemon to keep the time in sync continuously.
/etc/init.d/ntpd start

Then, we will sync the current date / time to the server's hardware clock.
This can be done as follows:

hwclock --systohc

Please note that to check your current date, you simply need to execute the 'date' command

Accessible and Valid XHTML 1.0 Strict and CSS