PHP Tutorials

  • Upload Photos to Flickr with PHP

    I have a bit of an obsession with uploading photos to different services thanks to Instagram. Instagram's iPhone app allows me to take photos and quickly filter them; once photo tinkering is complete, I can upload the photo to Instagram, Twitter, Facebook, and Flickr. This process made me wonder what it would take to upload photos to Flickr using PHP. This post details how you can authenticate and upload photos to Flickr using PHP with phpFlickr.

  • Image Data URIs with PHP

    If you troll page markup like me, you've no doubt seen the use of data URI's within image src attributes. Instead of providing a traditional address to the image, the image file data is base64-encoded and stuffed within the src attribute. Doing so saves a network request for each image, and if you're the paranoid type, can prevent exposure of directory paths. Since creating data URIs is incredibly easy, let me show you how to do it with PHP.

  • PHP Text Messaging with TextMagic

    A few months back I wrote a shocking expose about how sending text messages with PHP was as simple as a simple call to mail(). The only drawback to using the mail method is that you need know the carrier for a given phone number — a humiliating question to ask anyone you plan to advertise to. Luckily there's an simple, effective web service available called TextMagic. TextMagic provides an API for a variety of languages (PHP, Perl, Python, Ruby, Java, etc.) and is very easy to configure.

  • XBox Live Gamer API

    I've thought long and hard about this, and I still can't decide whether or not I should consider myself a "gamer." During my lifetime, I've owned an original Nintendo, Sega Genesis, Nintendo64 (best controller of any console ever), wii, and XBox 360. I used to have a horrible habit of downloading pirating games, but that's long and over with. Anyways, the only game I've played consistently over the past three years is Call of Duty. Which one? Whichever the latest Call of Duty has been most recently released. I don't even care to attempt the story mode; I simply want to log on and shoot each and every one of you I encounter.

  • Adaptive Images

    The landscape of web continues to change as we get more and more devices that we need to support. One concern when creating websites that should accommodate all screen sizes is image size. The acceptable size for an image is not the same across devices, so we usually end up compromising image size and quality on all devices; not the optimal solution, of course. Enter a solution called Adaptive Images, a PHP / .htaccess based solution for detecting screen size and delivering optimally sized images for the user's device.

  • Send Text Messages with PHP

    Kids these days, I tell ya.  All they care about is the technology.  The video games.  The bottled water.  Oh, and the texting, always the texting.  Back in my day, all we had was...OK, I had all of these things too.  But I still don't get the volume of texts that I hear my younger female cousins send.  Thousands and thousands of them each month.  WTF are all of these texts for?  Here's a thought:

  • Parse Web Pages with PHP Simple HTML DOM Parser

    For those of you who have had the pleasure of following me on Twitter (...), you probably know that I'm a complete soccer (football) fanatic.  I even started a separate Twitter account to voice my footy musings.  If you follow football yourself, you'll know that we've just started the international transfer window and there are a billion rumors about a billion players going to a billion clubs.  It's enough to drive you mad but I simply HAVE TO KNOW who will be in the Arsenal and Liverpool first teams next season.

  • Google PageRank PHP Class

    It appears that Google has changed their Page Rank mechanism. I'm currently investigating ways to restore the functionality of this class.

  • Android Detection with JavaScript or PHP

    I've noticed that two of my blog posts continue to get more popular each week:  iPad Detection with JavaScript or PHP and iPhone and iPad detection with JavaScript or PHP. What's obvious is that Android development is a hot topic that will only grow.  Here are a few methods by which you can detect iOS' main competitor:  Android.

  • MooTools Star Ratings with MooStarRating

    I've said it over and over but I'll say it again:  JavaScript's main role in web applications is to enhance otherwise boring, static functionality provided by the browser.  One perfect example of this is the Javascript/AJAX-powered star rating systems that have become popular over the past five years.  Star rating systems are attractive, allow us to avoid ugly forms, and prevent unnecessary page reloads.  A new plugin by Lorenzo Stanco called MooStarRating has hit the MooTools Forge and I wanted to share with you how to use it.