PHP Tutorials

  • By
    Create Tiny URLs with TinyURL, MooTools, and PHP

    Since we've already figured out how to create TinyURL URLs remotely using PHP, we may as well create a small AJAX-enabled tiny URL creator. Using MooTools to do so is almost too easy. The XHTML (Form) We need an input box where the user will enter...

  • By
    Create a TinyURL with PHP

    TinyURL is an awesome service. For those who don't know what TinyURL is, TinyURL allows you to take a long URL like "https://davidwalsh.name/jquery-link-nudging" and turn it into "http://tinyurl.com/67c4se". Using the PHP and TinyURL API, you can create these tiny URLs on the fly! The PHP Simply...

  • By
    Send Email Notifications for Broken Images Using jQuery AJAX

    It's usually best to repair broken image paths as soon as possible because they can damage a website's credibility. And even worse is having a user tell you about it. Using jQuery and PHP, you can have your page automatically notify you of broken...

  • By
    Add the Script & Style Feed to Your Website

    Script & Style is a website created by myself and Chris Coyier where bloggers and developers alike submit articles about CSS, XHTML, jQuery, MooTools, and other website design and development topics. The site's popularity continues to grow due the community's enthusiasm and...

  • By
    Check for Function and Class Existence Using PHP

    When you've inherited a big website or you're working on a group website where you don't have quick access to communicate with the other developers, it's important to not assume that a custom function or class name has not already been defined. Here's how you...

  • By
    PHP:  Validating Numeric Values and Digits

    I've inherited a lot of code where the previous developer used PHP's is_numeric() and it's gotten them into trouble. There's a big difference between validating that a value is numeric and validating that a value is all digits. Here's how to validate the two: A...

  • By
    Simple Username Creation Validation with PHP

    When I create login areas (mostly intranets) for small websites, I'm always asked by the customer to keep usernames to letters and numbers. That means no email addresses as usernames and special characters like "_", "-", and ".". This, in my customer's mind, keeps the...

  • By
    Breaking & Fixing Dates from MySQL to PHP

    The way that databases store "date" field data is: The way that us humans read dates (at least in the U.S.) is: I write a lot of administrative panel modules that either display dates or, better yet, allow customers to their own dates for articles, events, etc.

  • By
    Using MooTools 1.2 For Drag, Drop, Sort, Save

    This post has been updated: Using jQuery or MooTools For Drag, Drop, Sort, Save. The code on this page is no longer best practice. The following is a repost of an article that ran on Script & Style a few months ago.... My...

  • By
    Technorati Grabber:  Get Your Technorati Rank and Authority

    Technorati is one of those sites that's like Alexa in that you get an assigned rank. You also get what is called "authority," which represents: Technorati Authority is the number of blogs linking to a website in the last six months. The higher the number, the...