OK, here's the code.  I modified this a coon's age ago to run under
Apache (saw your post above).  Its still got my mod notes in it so you
should be able to convert it back to IIS if you want.  Also looks like
I put some stuff in (the return scope for the var) that wound up being
never used, so cull it out if you like.

--
--Matt Robertson--
MSB Designs, Inc.

--------------------------------
CODE BEGINS HERE
--------------------------------

<cfprocessingdirective pageEncoding="utf-8">

<!---
<CF_FakeURL>

Creates URL parameters from values passed as part of the path (as
opposed to in the query_string). This technique helps ensure that
search engines and spiders index pages that might have been ignored
(as some ignore any dynamic URLs).

Using this tag, a URL like this:

foo.cfm/FName/Ben/LName/Forta

will be processed and two URL variables will be created: URL.FName=Ben
and URL.LName=Forta.

To use, simply place <CF_FakeURL> anywhere in your page (before the
first URL variable is needed). By default / is used as the delimiter;
an alternate delimiter may be specified in the DELIMITER attribute.

Ben Forta - [EMAIL PROTECTED]
12/1/2001
--->
<!---
Revisions to this tag for use by CMPro:
1. scoped all variables.
2. Added the test to determine if query_string_length is zero (i.e.
initial visit to home page)
3. Change the url variable setter to CFSET instead of CFPARAM (url.ID
gets a default setting in application.cfm)
4. made the scope of the returned variables variable (not presently used).
5. This version for Apache web servers uses cgi.request.uri instead of
cgi.path_info.
--->
<!---
initialize attributes
--->
<CFPARAM NAME="attributes.VarScope" DEFAULT="url." TYPE="string">
<CFPARAM NAME="attributes.delimiter" DEFAULT="/" TYPE="string">
<!---
Extract "query_string" from full path
--->
<CFSET variables.query_string_length=Len(cgi.Request_Uri)-Len(cgi.Script_Name)>
<CFIF Len(variables.query_string_length)>
<CFSET variables.query_string=Right(cgi.Request_Uri,
variables.query_string_length)>
<!---
How many items in "query_string?
--->
<CFSET variables.items=ListLen(variables.query_string, attributes.delimiter)>
<!---
Must be an even number, if odd, bail
--->
<CFIF variables.items MOD 2 IS 0>
<!---
Loop through list, pair of items at a time
--->
<CFLOOP
FROM="1"
TO="#variables.items#"
STEP="2"
INDEX="i">
<!---
Get each pair, first is name, second is value
--->
<CFSET variables.i1=ListGetAt(variables.query_string, i,
attributes.delimiter)>
<CFSET variables.i2=ListGetAt(variables.query_string, i+1,
attributes.delimiter)>
<!---
Save this URL parameter
--->
<CFSET "#attributes.VarScope##variables.i1#"=variables.i2>
</CFLOOP>
</CFIF>
</CFIF>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to