Category: Web Development
-
PHP script to send test emails on a schedule to make sure you are able to receive email
Ever wondered if your email was actually working? I’ve had numerous people over the past few years wonder the same thing. Ideally you would use a consistent, dependable email service provider (think Gmail, Hotmail, Yahoo!, etc.). But sometimes that isn’t an option. If you think you might be receiving email intermittently or not at all,…
-
Shorten URLs with Zend Framework and bit.ly
This function uses version 3.0 of the bit.ly API. You’ll need to register for an account with them if you don’t already have one. Then you can retrieve your API key and begin using it immediately. function bitlyShorten($url) { $client = new Zend_Http_Client(‘http://api.bit.ly/v3/shorten’); $client->setParameterGet(array( ‘longUrl’ => $url, ‘login’ => ‘xyz’, ‘apiKey’ => ‘xyz’ )); $response…
-
Force Zend Framework to use the index controller by default
Everyone wants pretty URLs these days—both for convenience and to optimize for search engines. So having URLs with unnecessary information is a major no-no. Over the past year I’ve been slowly absorbing the Zend Framework and its MVC pattern. Historically, projects I created required the user to specify the index controller like so: http://www.mysite.com/index/page …where…
-
Caching With Zend Framework Using Zend_Cache
Today I taught myself how to use Zend_Cache and implemented it within 20 minutes. It’s super easy and very effective. Take a look at the code sample below and you’ll be up and running in no time. Step 1: Setup the Cache {code type=php} $frontendOptions = array( ‘lifetime’ => 180, // Cache for 3…
-
How to backup your website
Everyone knows (or should by now) that cheap web hosts (Bluehost, Dreamhost, MediaTemple, etc.) don’t backup your data for you. So you’d better do it yourself. If you’re on any respectable host, you should have ssh access to the box. Connect to your box via ssh and run the following commands to create a backup…