Archive for the ‘PHP’ Category
Monday, November 1st, 2010
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 ...
Posted in DIY, PHP, Programming, Web Development | No Comments »
Thursday, August 26th, 2010
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.
{code type=php}
function bitlyShorten($url)
{
$client = new Zend_Http_Client('http://api.bit.ly/v3/shorten');
$client->setParameterGet(array(
'longUrl' => $url,
'login' => 'xyz',
'apiKey' => 'xyz'
));
$response = $client->request();
if($response->isSuccessful())
{
$response = ...
Posted in APIs, PHP, Programming, Web Development, Zend Framework | No Comments »
Tuesday, July 6th, 2010
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 ...
Posted in PHP, Programming, Web Development, Zend Framework | No Comments »
Monday, August 17th, 2009
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 minutes
'automatic_serialization' ...
Posted in Amazing, PHP, Programming, Software, Web Development, Zend Framework | No Comments »
Tuesday, January 13th, 2009
$utc_time = "2009-01-12 21:28:21"; // As pulled from the database
date_default_timezone_set("America/New_York"); // Set to Eastern time (automatically handles daylight savings time)
// Here's the secret: add a Z (for zulu) ...
Posted in PHP, Programming, Web Development | 2 Comments »
Monday, July 7th, 2008
So I'm trying to debug my PHP script and the error stays the same no matter what I add to the end. Hmm...let me check the PHP manual for trigger_error.
It turns out that trigger_error automatically truncates messages to 1024 characters. That's not very helpful!
Source: PHP Manual - trigger_error()
No ...
Posted in Annoying, Depressing, PHP, Programming, Ridiculous | No Comments »
Tuesday, June 3rd, 2008
Web services are the coolest technology I know of that ends up turning everyone off. I don’t know about you, but when I go to a lecture on Web services, invariably tons of acronyms come out, like Representational State Transfer (REST), Extensible Markup Language (XML), Remote Procedure Call (RPC), SOAP, ...
Posted in Humor, PHP, Programming, Quotes, Software, Web Development | No Comments »
Tuesday, January 15th, 2008
When I started jeremyglover.com in 2005 I used MediaTemple. *GAG*. They are overpriced and have horrible quotas for both bandwidth and storage. I searched for a host and found BlueHost. Woo hooo!
All you have to do is take a look at the stats on the right ...
Posted in Amazing, Deals, Hosting, IT, PHP, Programming, Reviews, Software, Technology, Web Development | 3 Comments »
Sunday, December 30th, 2007
Old Hard Drive + Remove All Permissions + Try to Access Drive = Permission Denied
Hmm...that's a problem.
My uncle had an old hard drive in his computer with NTFS permissions that had been used as his primary hard drive with Windows XP on it at some point. Now it's a ...
Posted in IT, PHP, Programming, Security, Software, Technology | 2 Comments »
Wednesday, December 5th, 2007
I wrote a nifty little custom error handler for a PHP project I am working on and noticed I was getting more errors than I was before. Hmm...what was wrong? Apparently if you use a custom error handler in PHP you must explicitly check to see whether the ...
Posted in Annoying, PHP, Ridiculous, Software, Technology, Web Development | No Comments »