Tag Archives: php

CakePHP Tip – Creating static page

There is an easy way of creating a static page in CakePHP. This tip allows also to create non-authenticated pages among applications that needs authentication. For the purpose of this example, we will create a static page http://www.yourdomain.com/about. 1. Go to /app/config/routes.php, and add this line: Router::connect(‘/about’, array(‘controller’ => ‘pages’, ‘action’ => ‘display’, ‘about’)); 2.

Continue Reading →

How to detect iPad/iPhone hardware with PHP

Below a very useful snippet of PHP code that detects whether the person viewing your website is on a iPad or iPhone. Thanks to this solution you can redirect visitors to a different version of your website or just to another page. if(strstr($_SERVER[‘HTTP_USER_AGENT’],’iPhone’) || strstr($_SERVER[‘HTTP_USER_AGENT’],’iPad’)) { … }

Continue Reading →

About The Author