Uhm...  There's some problems inherent with using url strings to control
your variables.

First.  Why would you want to use a URL variable instead of a session
variable?  In application.cfm, you could just add:

<cfif isDefined("url.varname">
        <cflock scope="SESSION" timeout="10">
                <cfset session.varname = url.varname>
        </cflock>
</cfif>

Then use session.varname as you see fit.

Second.  Querystring variables are inherently bad to use for anything that's
important.  They are only really useful for saving searches.  Anything
that's even remotely critical is best handled through POST variables or
COOKIES...

Third.  Querystring variables are limited to one dimension values.  Sessions
can store arrays.  

Forth.  Querystrings, until IE 5.5, were limited to 255 characters.  This
limits the amount of variables you can have in a url unless you limit
browsers to IE 5.5 or better.

I have no idea why you would want to do what you are saying...  Perhaps you
could enlighten me as to why and perhaps more people would understand...


-----Original Message-----
From: Cornillon, Matthieu [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 29, 2002 9:35 AM
To: CF-Talk
Subject: query string variable idea


Hi, there.  In trying to solve a problem this weekend, it occurred to me
that I could easily handle my situation by passing a particular URL variable
with every link on my site.  Unfortunately, that would mean going through
and appending that URL variable to every link on my site, so I ended up
going with a different solution.
 
But then it occurred to me that I might be onto an idea for a future
project.  Why not set up my site so that every link on the site has the
local variable AppendToQueryString added to it.  So, every link would look
like this:
 
<a href="
http://www.mysite.com/subdir/file.cfm#Variables.AppendToQueryString
<http://www.mysite.com/subdir/file.cfm#Variables.AppendToQueryString> #">
 
In the Application.cfm, I set Variables.AppendToQueryString equal to ?noQS.
 
That way, any time that I want to solve a problem by adding a particular
query string variable, I can just add it on to Variables.AppendToQueryString
in the appropriate page.  I can also add things across the site by changing
the default value in Application.cfm.
 
This is all hypothetical: for now, I have no need for it.  But I was
wondering whether taking this infrastructure step is problematic for some
reason, or if there is some established better way of doing it.
 
Any thoughts?
 
Thanks,
Matthieu

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to