Tips and tutorials

Dynamically disable drop-down fields

Some workflow scenarios require that a drop-down field be disabled based on the value of another field. For example, you may want to disable the status field when the is_active field is set to No.

There are 2 types of drop-down fields in AppGini:

How to pre-populate a new record with data passed through the url?

In some cases, you might have frequent data entries with some common values. This can be made faster and more efficient using specially formatted shortcut links.

How to completely hide the membership system, making every user an admin?

This scenario is useful mainly if you are the only user of the generated AppGini app, and don't want to have to sign in every now and then, and want to remove the 'visual clutter' of the admin link, sign out link, .. etc.

Warning The following code basically makes every user a super admin. So, NEVER use this in a public-facing or multi-user app!

Protect your app login page from brute force attacks using reCAPTCHA

The code in this tutorial was tested on AppGini 22.13 and 22.14

A common problem facing all websites is malicious 'bots', automated scripts designed to "efficiently" perform harmful actions to websites. These include posting spam in forums, signing up with fake accounts (usually to post spam), trying to hack legit accounts by making thousands of password guesses in login forms (also known as brute force attacks), .. etc.

How to automatically detect the country of a user?

Using the free API service provided by ipinfo.io, 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("https://ipinfo.io/{$ip}");
  if($udata_json){
    $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.

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.

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.

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.
Syndicate content