Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / March 2008



Tip: Looking for answers? Try searching our database.

How to strip #CGI.HTTP_REFERER# after the ? params?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scooby Doobie Doo - 28 Mar 2008 16:46 GMT
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,"")>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.