I am trying to store the #CGI.HTTP_REFERER# address into my database, which
works, BUT, I don't want any characters after and including the ? in my url
for example, if I have
http://www.scooby.com/index.cfm?popo=yes&ID=22
I only want to store http://www.scooby.com/index.cfm
How can I strip that stuff after the ? before storing it?
Scooby Doobie Doo - 28 Mar 2008 16:54 GMT
Figured it out..
<cfset prefix = "http://">
<cfset full_path = "#prefix#" & "#CGI.SERVER_NAME#" & "#CGI.SCRIPT_NAME#">
-==cfSearching==- - 28 Mar 2008 17:09 GMT
[i]Figured it out..
<cfset prefix = "http://">
<cfset full_path = "#prefix#" & "#CGI.SERVER_NAME#" & "#CGI.SCRIPT_NAME#"> [/i]
Those are two different things. CGI.SERVER_NAME and CGI.SCRIPT_NAME refer to
the current page. CGI.HTTP_REFERER is the previous referring page.
You can use list functions to extract the first part of the HTTP_REFERER string
listFirst(CGI.HTTP_REFERER, "?")
Oguz.Demirkapi - 28 Mar 2008 17:16 GMT
<cfset myNewLink = ReplaceNoCase(cgi.http_referer,"?"&cgi.query_string,"")>