# Post URLs Usage

*Article Topics:* [*Sites*](/getting-started/common-topics/sites.md)*,* [*Members*](/getting-started/common-topics/members.md)

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.&#x20;

You can find these settings by visiting the [Sites Admin](/nats-admin/sites.md), selecting the tour you wish to edit, and expanding the Postback URLs tab with Show/Hide Advanced Settings.&#x20;

<figure><img src="/files/oEXqHYXxT0n0dTJBIyIm" alt=""><figcaption></figcaption></figure>

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.&#x20;

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

{% code overflow="wrap" %}

```
<?

/** 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';
 
?>
```

{% endcode %}

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.](/nats-admin/sites/further-reading/postbacks-and-post-urls/post-url-variables.md)"

For an example of these fields please see the "[Post URLs](/nats-admin/sites/further-reading/postbacks-and-post-urls/post-urls.md)"

## 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](/nats-admin/sites/further-reading/site-user-management.md) 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.&#x20;

You can view an example of a username check in our [Username Checking ](/nats-admin/sites/further-reading/username-checking.md)article.

## Related Articles

{% content-ref url="/pages/0bs9YRfx7qVudcgtZjPf" %}
[Username Checking](/nats-admin/sites/further-reading/username-checking.md)
{% endcontent-ref %}

{% content-ref url="/pages/uIjhebfyoyuLzf1glZtA" %}
[Site User Management](/nats-admin/sites/further-reading/site-user-management.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.toomuchmedia.com/nats-admin/sites/further-reading/postbacks-and-post-urls/post-urls-usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
