Eleeist
Eleeist

Reputation: 7041

Get URL with variables

How would I go about obtaining the URL of the requested page together with all variables? I know how to get the URL without variables.

eg. /forums/index.cfm?id=10&cat=5

Upvotes: 0

Views: 90

Answers (2)

ArdMan
ArdMan

Reputation: 166

Sam is correct about using:

<cfdump var="#cgi#">

However, what you may be interested in are the values from the CGI scope. For example, the CGI.HTTP_REFERER and CGI.HTTP_USER_AGENT. Please note the HTTP_REFERER will only be populated when the CGI.REQUEST_METHOD is POST and not on a GET request.

Upvotes: 0

Sam Farmer
Sam Farmer

Reputation: 4118

Dump out the cgi variables and you'll find what you are looking for and more.

<cfdump var="#cgi#">

Upvotes: 9

Related Questions