Tips and tutorials

How to automatically detect the country of a user?

Using the free API service provided by, you can add code into hooks for detecting the country of the current user, given his IP address. Here is how this code looks like:

  $country = 'Unknown'; // default in case country can't be detected
  $ip = $_SERVER['REMOTE_ADDR'];
  $udata_json = @file_get_contents("{$ip}");
    $udata = json_decode($udata_json, true);
    $country = $udata['country'];
  // you can now use $country in your code ...

Here is a demonstration that shows your country!

Your country is US

Country info retrieved from this service is ISO Alpha-2 abbreviation.

Using lookup fields in calculations

When customizing the before_insert, after_insert, before_update or after_update hooks to make a calculation, you might encounter a case where one or more fields in the formula you're calculating is a lookup field (foreign key). In this case, the value of $data['fieldname'] (where fieldname is the name of the concerned lookup field) is probably NOT the value you'd like to use for your calculation.

Step by step: hosting your AppGini application on Bluehost

Bluehost is a widely-used website hosting service that offers a friendly interface and good technical support at a reasonable price. Due to its popularity, we've wrote this detailed page describing step-by-step how to publish your AppGini-generated web application there.

Download free open source web applications

All the applications listed here are MIT-licensed free open source web applications generated by AppGini. You can easily customize them by editing the source code, or by editing the accompanying project files in AppGini (both the trial and full version of AppGini can be used).

Install AppGini on Ubuntu Linux

Mac users heads up! You can follow very similar steps to install AppGini on MacOS using PlayOnMac :)

Although AppGini officially runs on Windows PCs, you can still install it on your Linux or Mac by following the steps listed here.

How to obtain a Google Maps API key?

TLDR; To enable Google Maps support in your AppGini apps, you need to enable Maps Embed API and Maps Static API in your Google Cloud console, create an API key and copy it to AppGini.

Obtaining a Google API key can be quite challenging due to the complex, ever-changing interface of Google Cloud console. So, we are listing the specific steps in detail to get you started quickly.

Following are the steps to obtain a Google Maps API key (last updated October 22, 2019).

Creating an auto-updating balance field

In the Online Inventory Management application, the items table has a balance column (see the screenshot below) that keeps track of the current inventory balance for each item. It gets updated automatically whenever a transaction is made. Outgoing transactions decrease the item balance, while incoming transaction increase it.

Installing a local testing environment (xampp)

You can test your AppGini-generated web applications on a local machine before deploying them online. To do so, you need to install a web server, MySQL, and PHP. Of course, installing and configuring all of these programs is a lot of headache. Fortunately, there is an easier way: download and install Xampp, a single download that takes care of all the necessary work in one shot.

Note: All of the above tools are free and open source software.

Limiting user input to pre-defined options in AppGini

Some data fields in your application might allow users to select among only a limited set of options. We can set up fields this way using "option lists" ... Let's see how AppGini makes this possible in a few simple steps.

Syndicate content