Considering that you also have to identify a client, the server scope alone
may not quite get you where you need to be with this. You'll need to figure
out how to identify each browser, for instance, you could create a server
scoped structure ( server.clients ) which would then contain a list of ip
addresses for different browsers drawn from the cgi.remote_addr variable, or
you could use CF's CFID and CFToken pair although off the top of my head I'm
not sure if they vary between applications. I don't think they do, but I
wouldn't be surprised if I'm wrong. :)

Here's an example:

<cfif listlast(cgi.http_referer,".") is "com">

<cflock scope="server" type="exclusive">
        <cfparam name="server.client"
                type="struct" default="#structnew()#">
        <cfset server.client[cgi.remote_addr] = cgi.http_referer>
</cflock><cfset variables.domain = cgi.http_referer>

<cfelse>

<cflock scope="server" type="readonly">
        <cfif structkeyexists(server.client,cgi.remote_addr)>
                <cfset variables.domain = server.client[cgi.remote_addr]>
        </cfif>
</cflock>

</cfif>

<cfapplication name="#variables.domain#" ...>

FYI - the cgi.http_referer variable isn't always present on a given request
-- it can be filtered out by firewalls and the like.

hth

s. isaac dealey                954-776-0046

new epoch                      http://www.turnkey.to

lead architect, tapestry cms   http://products.turnkey.to

tapestry api is opensource     http://www.turnkey.to/tapi

certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816



> I know that makes no sense, but here's what's happening.

> I'm name a site that serves as a dynamic site for multiple
> companies.
> I need to name the Application and set variables by the
> CGI.HTTP_Referer
> variable.
> No problem so far.

> However, since the site is blind forwarded to my server,
> the HTTP_Referer
> variable
> changes once it's working off my server.  When it comes
> from the company
> that
> handles my DNS, it comes as http://www.bodafordhomes.com,
> from which I can
> do a CFIF CGI.HTTP_Referer contains ".com" and that tells
> me that the
> homepage
> has been requested from somewhere besides my server and
> the ID of the
> company
> needs to be determined for the dynamic site to be setup.
> I have
> http://www.bodafordhomes.com
> stored in the database from which to ID the company and
> choose it's data.

> The problem comes when the pages are served from my
> server.  They use URL's
> like http://77.88.99.00/cfdocs/rea/index.cfm , so the new
> CGI.HTTP_Referer
> can't
> be used to determine company ID any longer and the
> Application can't user
> the CGI.HTTP_Referer
> any longer as a name, because the Application name has to
> stay the same to
> keep the variables
> tied to the Application...

> I need to store the first CGI.HTTP_Referer variable, then
> when the
> Application.cfm
> page is consulted, I can recall that saved original
> HTTP_Referer variable as
> some other
> variable and rename the Application.cfm with it.

> There's the question:  How to save that variable, since I
> can't use
> application or session
> variables because on the second trip to the
> Application.cfm page, the
> Application will
> not have been defined and therefore an error occurs.

> Is there some variable that can be created after the first
> Application is
> named, then
> continue to be used until the Application is renamed?

> (I have got to learn how to do my own DNS, then I probably
> wouldn't have
> this problem.
> But I only have one server, and I need two for DNS
> service...don't I?)

> If I can get past this part, I've got the rest of this
> "one site for many
> companies" licked...

> If this is all crazy and someone else has a solution for
> this situation, I'm
> all ears...uh...or eyes...

> Rick


> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~|
> Archives:
> http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
> Subscription: http://www.houseoffusion.com/cf_lists/index.
> cfm?method=subscribe&forumid=4
> FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
> Get the mailserver that powers this list at
> http://www.coolfusion.com

>                               Unsubscribe: http://www.houseoffusion.com/cf_lists/uns
>                               ubscribe.cfm?user=633.558.4


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to