Q:

if ($_REQUEST) in Coldfusion

I am trying to use an if statement to check if the user has been directed to this page with from the correct location with correct data.
in php we would use

if ($_REQUEST)
{
......
}

but how can I do it in coldfusion?

A:

According to this, $_REQUEST is:

An associative array that by default contains the contents of $_GET,
  $_POST and $_COOKIE.

In which case, there is not an equivalent in Coldfusion.  The $_GET would be equivalent to CF's URL scope.  The $_POST would be equivalent to CF's FORM scope.  The $_COOKIE would be equivalent with CF's COOKIE scope.  You would need to check the appropriate scope depending on what you are looking for.
There are, however, frameworks for Coldfusion, such as Coldbox, that manage a "Request Collection" for you.

A:

With more information this answer could be more complete.
You can check where the user came from using CGI.HTTP_REFERER. Example:
if (CGI.http_referer contains 'www.good-domain.com') { ... do something here ... }

You'll need to check the URL or FORM scopes to inspect the data to see if it is the "right data". You can inspect these values with something simple like this (which checks the form scope--used when data is posted in the body of a request):
requestIsGood = true;
requiredKeys = ['keyA','keyB','keyC'];
for (key in requiredKeys) {
    if (!structKeyExists(FORM,key) {
        requestIsGood = false;
        break;
    }
}

if (requestIsGood) { ... do something here ...}

Lastly, the difference between the URL and FORM scope in ColdFusion (CFML) is that values in the url's querystring will be populated to the URL scope. Values posted by the form will exist in the FORM scope.
The code examples should be accurate for Adobe ColdFusion 9+ http://adobe.com/go/coldfusion and the open source CFML engine Railo http://getrailo.org. It may work on another open source CFML engine OpenBD http://www.openbluedragon.org/ but I am not sure.
Hope this information helps you.

