• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

need help with script

ok, the following script takes http://www.company.com/variable/whatever and parses out #variable# and sets it accordingly. I now need it to also find company.com as well. Its friday and I'm brain dead right now, been coding all day. Can somebody help me out?

<cfset request_url = #cgi.query_string#>
<cfset intTempIndex = Find("://", request_url) + 4>
<cfset intStartIndex = Find("/", request_url, intTempIndex) + 1>
<cfset intEndIndex = Find("/", request_url, intStartIndex)>
<cfif intEndIndex EQ 0>
<cfset intEndIndex = Len(request_url) + 1>
</cfif>
<cfset strDomain = Mid(request_url, intStartIndex, (intEndIndex - intStartIndex))>
 
I don't know CFM ,but logiclly you would follow these steps Find the :// and find the first single / (maybe substring after :// and find the first slash) . If there is no slash after domain (http://www.company.com ), use the char past the last. Now do a substring from the :// position to the position of the first single slash(Or the empty char). I hope that helps you.
 
Back
Top