All posts in Code and Servers


MySQL Class for PHP

This should get you started if you’re looking to connect to MySQL database.


Show Errors in PHP

In the good “old” days when 99% of all websites looked horrible, PHP would by default spit out all errors. If you made a mistake in your code, you’d get gracefully “notified”.

With PHP 5 we arrived to a new era of hidden rebukes – page just loads totally blank by default.

If you like games, you can just start searching the problem from your source code! If you have less than 100k lines you’ve got a good chance to find the issue before dawn.

If not, just drop these lines to the beginning of the script – should be fine…

ini_set('display_errors', '1');

Sanitizing Input in Flash

Let’s say for example you are creating a bulletin board system or some post system from within flash and you would like to restrict the use of any html or special characters.

Flash Socket Policy Server

We have a custom built communication server that can handle video/audio and text. Well a while back we wrote a flash client for this server. Well Adobe had just updated their flash player to include some new security enhancements one of which involved not allowing cross domain policy files to be served up via HTTP. There had to be a server listening on port 843 in order to serve the policy file. So I went to task of whipping one up real fast.

Multi-language support in T-SQL

This is brilliant, a little scary, but brilliant. (note added July 2010: OK, A LOT SCARY!)

While back we built a website supporting unlimited languages and articles. For a reason unknown I decided to keep all my content in one table, index it and link my other tables to it.

Updates and Joins in MySQL

Now this is supremely hot. You can update a whole set of information from one table to another without passing any data from your PHP. Not sure if this works with MS SQL, I’ll check next time I’m around those machines.

Increasing max upload limit in WordPress

I was working on adding some fancy media content  for one of my customers, and WordPress gave me this error:

This file is too big. The maximum upload size for your server is 2M.
Back to Top