Years ago I showed you how to force a file to download with PHP. Now with HTML5, you [almost] don't have to do that anymore.
Before HTML5, working with arbitrary data sucked. To keep things valid, you had to stuff things into
class attributes. Some developers even created their own custom attributes. Boy, was it a mess.
When I learned how to use the ternary operator years ago, I fell in love with it. What a cool way to simplify assignments based on a condition. If you're not sure what the ternary operator is or how it works, you're missing out on a really cool piece of programming knowledge.
Did you know you can record screencasts using QuickTime? Me neither, but you can.
Composer is a cross-platform dependency manager for PHP libraries. This article will explain how to install it on OS X and add an alias so you can use it from anywhere.
You can easily add some basic headers and send HTML emails using the PHP mail() function, but sometimes the resulting messages don't seem to display correctly in certain email clients -- especially those that don't support HTML emails. The best thing to do is send both a plain-text version and an HTML version of your message in the same email.
I've documented the steps that I've taken to successfully install and configure TinyMCE's PHP Spell Checker plugin to use the Google spell checker service. It's easier than you think, but there's not much in the documentation that clearly states the entire process, so here you go.
A demonstration of selecting checkboxes using jQuery.We start off with a bunch of checkboxes:
With the deprecation of the
target attribute in XHTML Strict, opening links in new windows has become a bit trivial, if not annoying, to standardize. I always look for a consistent, unobtrusive approach that degrades gracefully; and since I use jQuery quite frequently, this is how I usually handle them.
$table using the associative array keys as field names and the values as values (requires an existing open database connection).
I was recently asked to integrate PayPal IPN into a website that sells online article subscriptions. Basically, the client wanted all users who signed up via PayPal to instantly have access to the website (as opposed to making them wait for someone to manually approve each transaction). The backend was coded in PHP and featured a MySQL database for storing users' information.
I've done some work to try to simplify the process of adding and removing elements to a page dynamically. For basic applications, the
removeElement() functions I've written should be able to handle the job. For more complex applications, you'll have to pick apart the code and write your own methods.
It's not uncommon so see someone surfing the net with their cell phone or PDA these days or, at least, trying to. Unfortunately, portable technologies still have a long way to go before they conquer the web with their tiny screens. The good news is that, with a little help from stylesheets, your website can look presentable even in the palm of somebody's hand!
Blockquotes can be an effective way to communicate content to your users. When styled well, they can be an attractive addition to your website. The best part about blockquotes is that most people actually read them.
The simplest way I know to password protect files and directories using Apache's
This article aims to describe the difference between the three most popular types of images used on the Web, and how to use them effectively in your websites.