Replacing Union Platform Default Derby Datasource with MySQL Server
Union Platform is powerful and easy-to-use multiplayer server written in Java. By default it uses an embedded Derby database. In this article I’ll show you how you can replace this datasource with a MySQL one and how to process the database with minimum downtime.
Full StoryCorrect Name Capitalization in PHP
One annoying scenario is when you let users enter their names and then you need to output their names nicely, for example in a newsletter. Some users simply enter their names in upper/lowercase, but obviously when you address them you can’t do the same. On the other hand PHP’s ucfirst() and ucwords() functions are too naive for proper capitalization.
Full Story
PHP Download Script with Resume option
A while ago I wrote an article about the common pitfalls of handling file downloads in PHP. One thing I did not realize at that time is that in most cases developers don’t have the time to write such a script and they’ll use whatever they can find, even if it has flaws. Because of this, I decided to write a download script and release it free for everyone with a BSD License. It’s not a class, just a script that accepts a “file” parameter via GET or POST and outputs the file. For security purposes any paths are stripped and replaced with a path in the script (the folder containing the downloadable file(s) should be protected against direct access).
Full Story
A simple server-side dashboard for Union Platform
Union is a development platform for creating multiuser applications. It contains a server written in Java and client libraries in AS3, Javascript with Websocke and even server-side with Node.js. The communication protocol is XML-based and open so anyone can write a custom client in any language. In fact, in this article I’ll show you how Union can talk with PHP.
Full Story
The “right way” to handle file downloads in PHP
I’ve seen many download scripts written in PHP, from simple one-liners to dedicated classes. Yet, at least half of them share common errors; in many cases programmers simply copy the code from something that works, without even attempting to understand what it really does. What follows is not a complete working download script, but rather a set of issues you should be aware about and that will allow you to write better code.
Full Story
Should your CMS be allowed to do that?
I happen to love WordPress. Its features and sheer variety of plugins makes it ideal not just for blogs but for a whole range of sites. Having worked with many CMSes, both opern source and proprietary, I think WP strikes the best balance between features and ease of use. However, recently there has been quite [...]
Full Story
A Simple Twitter Search Parser with PHP
I was recently asked to aggregate tweets based on their hashtags using PHP (no Ajax), so I decided to turn this into a small tutorial that will hopefully enable you build all sorts of XML parsers in PHP.
Full Story
VirtueMart quick tip: show brand/manufacturer logo in product details
VirtueMart supports Manufacturer details but by default it just shows the manufacturer’s name in brackets, with a javascript pop-up window, that looks pretty ugly. Fortunately we can add the logo by using the description field of the Manufacturers details and by hacking one file.
Full StoryUsing MySQL to generate daily sales reports with filled gaps
I was surprised to see that there’s not a great deal of info on the web on how to do a proper daily report – one that doesn’t have any gaps when data is missing. In this post I’ll try to quide you through building such a report using MySQL and PHP for a nice chart.
Full Story
Does your PHP/MySQL app speak Unicode?
I find it very annoying when I come across web apps that still can’t handle non-ASCII characters correctly. In this article, I’ll show you how, with just a few lines of code, you can “globalize” your online app.
Full Story