In writing PHP code, several characters need to be “escaped” for the code to run properly. If not, the browser will be blank or show errors. The following characters have to be escaped, which means you write a backslash ( \ ) in front of it. For example: \- (the hiphen) or \. (the dot). Other special characters [...]
Continue reading...Saturday, October 11, 2008
Ruby on Rails started the framework race, so we’ve been trying several of them. Since we are PHP developers, we tried CakePHP. We liked it, but its configuration is complicated. We stumbled upon CodeIgniter and were surprised how easy is was to install; in, fact it’s zero config! Here’s a summary from EllisLab: “CodeIgniter is a [...]
Continue reading...Monday, October 6, 2008
Here are a list of web development cheat sheets we have found: CSS cheat sheet: http://www.addedbytes.com/cheat-sheets/download/css-cheat-sheet-v2.png Regular Expression cheat sheet: http://www.addedbytes.com/cheat-sheets/download/regular-expressions-cheat-sheet-v2.png PHP cheat sheet: http://www.addedbytes.com/cheat-sheets/download/php-cheat-sheet-v2.png MySQL cheat sheet: http://www.addedbytes.com/cheat-sheets/download/mysql-cheat-sheet-v1.png HTML cheat sheet: http://www.addedbytes.com/cheat-sheets/download/html-cheat-sheet-v1.png HTML character entities cheat sheet: http://www.addedbytes.com/cheat-sheets/download/html-character-entities-cheat-sheet.png Javascript cheat sheet: http://www.addedbytes.com/cheat-sheets/download/javascript-cheat-sheet-v1.png Ruby on Rails cheat sheet: http://www.addedbytes.com/cheat-sheets/download/ruby-on-rails-cheat-sheet-v1.png
Continue reading...Saturday, September 20, 2008
Here’s a php code snippet to force the page to https instead of http. You can use a self-signed SSL certificate on your OS X testing server. <?php // force redirect to SSL secure page if($_SERVER['SERVER_PORT'] != '443') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); exit(); } ?>
Continue reading...Tuesday, September 9, 2008
“Unfortunately the Mac OS Leopard PHP build doesn’t bring GD library installed. There are many tutorials around the web telling how to patch the system so you can have it working but all are very complicated and require the installation of Xcode, etc, so you need some gigs of free HD space and a lot of [...]
Continue reading...Monday, September 8, 2008
This is a PHP module for the Apache web server included in Mac OS X. PHP is a server-side, cross-platform, HTML embedded scripting language. 1. Download the PHP package here: http://www2.entropy.ch/download/entropy-php-5.2.4-1-apache2.tar.gz 2. Install it, then test it at http://127.0.0.1/~your_username/test.php Thanks to Marc Liyanage for the PHP package.
Continue reading...Monday, September 8, 2008
Create a new text document in your Sites folder named info.php. Enter this into the doc: <?php // Show all information, defaults to INFO_ALL phpinfo(); // Show just the module information. // phpinfo(8) yields identical results. phpinfo(INFO_MODULES); ?> Test it at http://127.0.0.1/~yourusername/info.php
Continue reading...
Sunday, November 30, 2008
1 Comment