Dagu on September 14th, 2009

The if construct is one of the most important features of many languages, PHP included. It allows for conditional execution of code fragments. PHP features an if structure that is similar to that of C: if (expr) statement The general format of if construct is like shown below: if (expr1) { //  statement if expr [...]

Continue reading about IF Construct in One Line Using PHP

Dagu on November 10th, 2008

A few CMSs need PHP library which is not activated as default. For example, in installation an e-commerce named magento (www.magentocommerce.com), needs a few PHP extensions. Usually, a good CMS checks system requirements before installation begins. Image below is an example for system requirements checking on Magento Installation. We could use phpinfo() function to view [...]

Continue reading about Load PHP Extension

Dagu on December 19th, 2007

Case study: We would like to provide pdf files to be downloaded by visitors, but the file location is hidden. Visitors can download file with URL given only. Programming language used is PHP. Analysis: We could make a link directly to the file location. Example: <a href=”myebook.pdf”>Download MyEbook</a> What happen if the link above clicked? [...]

Continue reading about Avoid Direct Download