Anyone who develops Javascript long enough undoubtedly runs into difficulties involving the various security features all browser vendors implement. These security features are a good thing — they protect us from malicious users hijacking our browsing experience. But they can certainly cause some headaches. The security feature that presents the most difficulty for us as developers is the same origin policy.

In a nutshell, this policy prevents pages from two different domains from modifying each others properties, using XMLHttpRequest, setting cookies etc. For instance, Example.com and OtherExample.com can’t get references to each others document properties and can’t set cookies on each other. Additionally, Example.com can’t use XMLHttpRequest (aka AJAX) to load a resource from OtherExample.com. This last bit is probably the biggest issue for developers today — in todays world of open web services and mashups. How do you consume a web service with Javascript if you can’t load the data properly? Read the rest of this entry »

Today I want to talk about daemonizing PHP scripts on Linux servers — creating scripts that are meant to run in the background for long periods of time. After we’ve covered that, I’ll explain how I like to use supervisord to manage these long-running PHP processes.
Read the rest of this entry »

PHP offers a convenience superglobal called $_REQUEST that coalesces input from a number of sources into one easy to use array. A common thought amongst PHP developers is that you should avoid the use of $_REQUEST — but do you actually know why? Read the rest of this entry »

I’ve compiled a list of 8 features that are inherent to all badly designed software. This list is in regards to code design — it’s about architecture. Read the rest of this entry »

A friend of mine who is rather new to PHP was getting super confused about timestamps and timezones. So I thought I’d post a quick thought about timestamps today to clear up some confusion. Read the rest of this entry »

Today I want to talk about best practices in regards to reading user input. And if you haven’t already, I’m going to convince you why using PHP’s superglobal arrays are bad. Read the rest of this entry »

Just a quick post today around the topic of scalability. This is really a broad topic, but I wanted to give sortof a “starting point” or overview of how to create very scalable websites. The newest of my projects requires the system to scale infinitely, so I had to do a lot of research. I found enough articles on the subject but I never really found a checklist of sorts that pointed me in the right direction, everything was so open-ended. Read the rest of this entry »

If you talk to me regularly then you already know how much I love stream wrappers in PHP. The other day I was positively giddy with how easy it was to solve a particular problem by using stream wrappers. Read the rest of this entry »

Now that I’ve already covered what Unicode is in another post, it’s time to talk about actually using it. Today I’ll talk about how to create PHP applications that correctly handle Unicode. Read the rest of this entry »

I have a lot of developer friends who are still confused about the idea of character sets. The internet is a global phenomena; in today’s world, every developer must understand character sets if they are to create applications that work around the world. Read the rest of this entry »