Post URLs Usage

Article Topics: Sites, Members

NATS gives you the option of posting to a URL of your choosing when different member-related events occur. This allows you to track and keep logs of surfers when they perform a specific action on your site, such as choosing a username, joining, and rebilling.

You can find these settings by visiting the Sites Admin, selecting the tour you wish to edit, and expanding the Postback URLs tab with Show/Hide Advanced Settings.

For example, with the Rebill Post URL field, you can have NATS post information to your specified URL on each member rebill.

Continuing with the Rebill Post URL example, NATS allows you to use PHP scripts at the URL page to further organize transaction information.

The PHP script here allows you to put your information into a log file:

<?

/** Adding a date to the first value. **/
$message = '[' . date('Y-m-d H:i:s') . '] ';
/** Looping through all request variables. If it is an array, we loop within. **/
foreach ($_REQUEST as $key => $val) {
/** Add what the value is, what the name is. **/
        if (is_array($val)) {
                foreach ($val as $val_key => $val_val)  $message .= "&{$key}[{$val_key}]={$val_val}";
        }
        else $message .= "&{$key}={$val}";
}
/** Adding a return message to the log **/
$message .= "\n";
/** Adding the log to the specified file **/
error_log($message, 3, '/path/to/nats4/user_management.log');
/** Respond NOTOK so the User Management call isn't triggered **/
echo 'NOTOK';
 
?>

With each post back you have access to several fields, allowing a great deal of customization in recording user transactions and information.

For a list of the fields in each post, please see "Post URL Variables."

For an example of these fields please see the "Post URLs"

Username Post URL vs. User Management URL

NATS can use both Username Post URLs and User Management URLs to keep track of member details and availability. The main difference between the two is that a Username Post URL is specifically for checking username availability, and is only called on during initial signup to verify username availability. A User Management URL will get a variety of calls, including add, check, delete, expire, etc. Learn more about User Management URLs in our Site User Management article.

Username post URLs will send all of the following variables to your script:

  • username

  • email

  • siteid

  • tourid

  • programid

  • loginid

Your script should echo "*exists*" if the username is already taken. This will refresh the page and prompt the surfer to choose a new username.

You can view an example of a username check in our Username Checking article.

Username CheckingSite User Management

Last updated

Was this helpful?