The Problem

You're part of a small-to-medium group of people who trust each other and have some reason to spend time and money together (e.g. you have a few housemates or you work in a friendly office environment). It's a huge hassle to constantly be requesting separate bills or lending each other money and losing track of who owes who how much and for what. You waste time quibbling over small amounts and people in your group don't like lending each other money or picking up the tab for lunch.

The Solution

Using this simple web application, a group of people who trust each other can keep a running tab of how much they owe each other. This is handy for figuring out such things as who should pay for groceries next time (e.g. whoever owes the most) and generally makes people more easy-going about spotting each other money or picking up lunch, as they know they can keep track of it. With PHPTab, any member of your group can be as lenient or penny-counting as they want, without ever having to actually be constantly be trading small sums of money. It's just a matter of "putting it on their tab".


  • Any member of the group with a computer/internet connection (and probably the password) can log or view the current debt
  • The interface is intuitive: A owes B $X for reason Y (e.g. Nick owes Mike $15 because of a sushi lunch)
  • Macros can represent one-to-many payments in any ratio (e.g Nick paid for his, Anna's and Mike's food, but they don't all eat the same amount)
  • It's easy to add/remove people and macros
  • It's easy to modify if you want to add bells & whistles or change the look'n'feel


Access to a web server with PHP & MySQL installed, and a little bit of web-savvy.


  1. Edit dbinfo.php:
    1. enter the MySQL database hostname, username, password and database name
    2. enter the prefix you would like the tables to have (using this feature, you can use multiple independent instances of PHPTab in the same database without them colliding)
  2. Upload all the files to your web server
  3. (Optional but recommended) Use .htaccess or something similar to put a password on the directory


Using the system is really simple, just fill in the form to record a transaction. 'From' and 'to' indicate who is doing the lending or paying and who is doing the receiving, respectively. One cannot go 'from' a macro but if you really know what you're doing, you can go 'from' a person 'to' a macro with a negative value.

People and Macros

Before using PHPTab, and at various time during use, you will need to add people or macros to the system. A person is one who can owe money. A macro is sort of a shortcut which can split debt according to given ratios. For example, Nick and Mike are people but NickandMike could be a macro that splits debt between Nick and Mike 50-50.

You can create macros and people by clicking on 'edit targets' on the main page. Under 'splits' when creating a macro, you can specify them in any form, they are normalized. For example, saying Nick: 3 and Mike: 2 will result in Nick owing 60% and Mike 40%. The same effect can be achieved by using 6 and 4 or 0.6 and 0.4 or 30 and 20 etc etc. This is handy when doing simple ratios like 3:4:5. You can view the splits for macros in the system at the 'view macros' page.

You can also 'deactivate' people or macros on that page, so that they no longer appear in the from/to lists and no more transactions can involve them. Note that only people with a balance of zero may be deactivated, otherwise all the math gets thrown off. For the same reason, if you deactivate a person, any macro they are a part of will be deactivated, and the 'delete' button will be hidden for any transactions they took part in.


A few bug fixes were contibuted by Adam Hasselbalch Hansen. Thanks Adam!

© Nicolas Kruchten 2010-2023