← Back to blog home

Archive for the ‘Quick Tips’ Category

PHP isset vs empty

02 Dec

A very common mistake when first getting in to PHP is to think that isset() and empty() can be used as each others inverse. This is VERY far from the truth and can cause major problems in an application. In this quick article I will explore the differences between isset and empty in PHP

Read the rest of this entry »

 
 

WordPress upgrade Call to a member function add_rewrite_tag() on a non-object

17 Nov

This is just a quick post for anyone who got the following error (as I did on a couple sites) when upgrading WordPress to 3.0+

Fatal error: Call to a member function add_rewrite_tag() on a non-object in … /wp-includes/taxonomy.php on line 289

Read the rest of this entry »

 
 

Easiest way to get the latest status from facebook fan pages in PHP

09 Nov

So, quite often companies what to show their latest post from their facebook fan page on their website. This should be really simple right. Well it is. However, it seems like most of the world wants to REALLY over complicate it. I searched for this forever and people didn't seem to understand: I don't want facebook connect. I don't need to log in a user. I shouldn't need to load the facebook sdk. I shouldn't need to create a facebook app. There has to be a better way. I thought to myself it's SUPER easy on twitter there has to be something similar for facebook and of course there is.

Read the rest of this entry »

 
 

Load latest twitter tweet in 1 line of PHP code

09 Nov

If all you're looking to do is load your latest tweet in the simplest way possible this is the function you need. Luckily Twitter formats all of the latest posts into simple RSS feeds which makes it SUPER easy to just go and get them. It honestly doesn't get any easier than this. Read the rest of this entry »

 
 

Easy jQuery form validation and email validator

21 Sep

This is a very quick way to make sure people fill out all fields of a form. It is easy to bypass and is in no way a replacement for server-side form validation, but it's a quick and easy way to prevent invalid form data from being submited. All of the code below requires you to include the jQuery JavaScript library. click here for more information about jQuery
Read the rest of this entry »

 
1 Comment

Posted in Quick Tips

 

Force PHP to show all errors or save them to a log for troubleshooting

17 Sep

Most servers are set to suppress PHP errors which can leave you guessing why something isn't working and make troubleshooting code almost impossible. This is especially frustrating when you install a 3rd party module with errors. Luckily forcing PHP to display errors is very easy.
Read the rest of this entry »