Force Secure Pages (SSL / HTTPS) with Zend Framework
If you have a PHP web application built using the Zend Framework, securing all its pages becomes very easy. You just go ahead and add the following tiny function to your Bootstrap file: What this does is that it captures any non-secure request (Over plain HTTP) and redirects it to HTTPS (HTTP Secure). As an [...]
Generating Command Line Colors with PHP
Generating ANSI (or ASCII) command line colors, or terminal colors, or whatever you call them, is easy with PHP. As I have said in my previous post, ANSI Command Line Colors under Windows, having colored text in the command line is a great help for spotting error or success messages. So here’s a quick and [...]
ANSI Command Line Colors under Windows
Having colored text in the command line is a great help for spotting error or success messages. Unfortunately, those of us developing under Windows do not have this feature by default. Here’s how to enable it: Download ANSICON from http://adoxa.110mb.com/ansicon/index.html or https://github.com/adoxa/ansicon Extract the proper files (Depending on if you have a 32 or 64 [...]
Changing the default Look and Feel of NetBeans
Why change the default Look and Feel? Aesthetics apart, every developer should change the default Look and Feel of NetBeans. Why? because it has an annoying bug. Here’s what happens: you’re pumping code in the NetBeans code editor like crazy. You need to switch to another window for a quick copy / paste from your [...]
Sending emails with Zend_Mail using Gmail or Google Apps
Zend Framework is currently one of the best MVC-based frameworks in the PHP world. Zend_Mail is part of Zend Framework and it provides the ability to easily send email messages. If you’re like me, most web applications you have developed are setup to use Google Apps as their email provider. Here’s how to send email [...]
Capture the output of var_dump in a string
Introduction You are programming in PHP and you have an array variable that you’d like to explore at different execution paths. Of course, the best way is to use a PHP debugger like xdebug or Zend Debugger, but, what happens when you’re too lazy to install a debugger? What happens when you don’t want or [...]
Hide Gmail’s spam count
Does the spam count in Gmail bother you? It certainly does. Are you too lazy to delete your spam messages every few minutes? Of course you are. Would you like to preserve your spam messages just in case they might contain a legitimate email? Of course you would love to. You hate using third party [...]
URL Rewriting for CodeIgniter
What is URL Rewriting? URL rewriting provides shorter and more relevant-looking links to web pages on your site. This improves the readability and the search rankings of your URLs. For example, URL “a” can be rewritten as URL “b”. a) http://example.com/index.php?section=casting b) http://example.com/casting There are many articles on the web discussing the benefits of shorter [...]
Hello world!
The ubiquitous Hello World post is here to stay. For the sake of programming traditions, we’re not removing it. But we do promise that our next posts will be more useful.