Need help stripping url for value

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
Ok,

I need to take a url and strip out content. I'm using CFM as the language...

First I need to look at the value after mytoken= I need to then set that as value "mytoken"

I don't need help with the form code for the initial url submission, i need help on the action page....

I have code that im looking at, it strips a url and looks for the initial subdirectory...

aka... www.company.com/subdirectory/file.jpg

returns subdirectory

Hopefully I can reuse the logic of this code for this new function....

http://www.company.com/index.cfm?fuseaction=search&myid=123&Mytoken=23423

This code strips url for subdirectory, looking to modify to find mytoken

<CFSET request_url = #cgi.query_string#>
<CFSET intTempIndex = Find("://", request_url) + 4>
<CFSET intTempIndex1 = Find("://", request_url) + 3>
<CFSET intStartIndex = Find("/", request_url, intTempIndex) + 1>
<CFSET intEndIndex = Find("/", request_url, intStartIndex)>
<CFSET intEndIndex1 = Find("/", request_url, intTempIndex1)>

<CFSET subDomain = Mid(request_url, intStartIndex, (intEndIndex - intStartIndex))>