Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Virtual" replicated web sites 1

Status
Not open for further replies.

Glasgow

IS-IT--Management
Jul 30, 2001
1,669
GB
I feel I should know this but I'm rusty...

Suppose a car manufacturer offers separate free web pages to its dealerships. I could envisage handling these with urls of the form:


I could then put logic in the DealerSite.asp code that drives the site content from data extracted from the database based on the dealer id in the URL. Fine!

But dealerships will want to use a more appropriate url like, say, How do I set up that new site such that it is effectively just a shell that executes the remote code on a central site without navigating to that site and changing the url displayed in the visitor's browser?

Thanks in advance.
 
I may have just refreshed my memory! Is Server.Execute the solution?
 
sounds like you're having an overlay environment basically 2 sites, end user and clientel at the same time, the major difference is a login at some point, or at least some form of specific identification. all driven on the same pages, and in the same space. if i'm mistaken please let me know kinda winging it here based on your description.

needless to say, you could use a cookie or session value to re-inforce that the user is identified, more usefully storing their ID, secondly you can point IIS to the same web space with different domains, it's in the advanced config ( where the ip addressing is )

you can also use request.servervariables("Server_Name") to determine which domain they are using especially considering it's running the same thing on a different name

sorry i dont have much more output for you without more input

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
Thanks for reply but I'm not sure we're on the completely the same track.

All I believe I want to do is run VbScript/ASP code that is sitting on a remote server. That code will build the HTML to be rendered locally. What I do not want to do is physically navigate away from the current site.

The further complication is that I want to pass a parameter to that code and the only apparent problem with Server.Execute is that I believe it does not allow a query string within its path parameter. But I am assuming that I can use Server.Execute to execute code on a remote server and that may be nonsense!

Is that any clearer?

All that said:
you can point IIS to the same web space with different domains
could also solve my problem as long as I can identify the dealer code (or, failing that, the "true" url) at run time.
 
server.execute wont run remote scripts, it needs access to the actual source file locally ( the server) if both namespaces are hosted by you, then this is possible, but if you're wanting to bassically make a website called woogle, then server.execute [ignore] + searchstring [/ignore] wont work, and it's called scraping, as well as theft

now i'm not pointing fingers, cause there are instances where you have to pull something from somewhere else, per example : updated dataset for say new product/pricing from your distributor, and that is usually done via means of XMLHTTP

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
Thanks for your further input. I take your point, of course, but can only assure you that what I am hoping/b] to achieve is completely above board - I want to execute my own code.

I also realise I'm wrong. Both sites will almost certainly be hosted by the same server. However, the problem remains as to how I pass a parameter to the code. Might you be able to help me with that?

 
ASP 101
<%
DealerID = request.querystring("dealerid")
Response.write "value of DealerID = " & DealerID
%>

yields :
value of DealerID = 1267


(using the link example in your first post)

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
Thanks - I am familiar with the approach but surely I cannot pass this parameter using server.execute?

I realise I could redirect the visitor to the necessary ASP page and pass a parameter in a query string but that's the very thing I do not want to happen. I want to execute the code from the original page/domain.
 
i guess i'm missing a puzzle piece, both name spaces are on the same server, you're wanting to run scripts from one on the other, without name space changes...so yes you can server.execute a given file, BUT it will run within the scope of the namespace it's in, and if your application variables, or global.asa's are too differentiated you'll end up with errors galore.

so that leaves you with a few options :
1. validate, replicate and confirm the data/operating/variable environments will coincide in order to server.execute if you must use this method.

2. if you're in control of both sites, have access to both and they appearantly are interlinked in some nature, why not replicate the file structure for this given task to the other namespace? then there's no shared docs that if one gets changed it breaks the other site

3. use XMLHTTP and "fetch" the output of the other namespace
then parse the xmlresponse

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
followup note on XMLHTTP it can be used gently to nudge another site to pass values via querystring with the end user none the wiser, so you can invisibly handshake the other server, this removes issues of possible client warnings of redirection or form redirection

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
another follow up note, in regards to you passing variables via server.execute .. yes in a way you can, server.execute works fairly much the same as a #include file , executes the code within as if it was part of the page, i do not know off hand if the server.execute shares the executed file's variables after the fact or not, but as a before hand notion is using a session variable to hold the dealer id, and that is carryable into the server.execute within the scope of the same namespace.

i would personally lean to the duplicate individualized copy or the xmlhttp methods more than server.executes in this particular instance mainly you're depending too highly on the 2 namespaces being too identical to keep executing sometihng from the other, concerns lie in updates, or due course of development and the divergence of the 2 sites as time progresses and each site becomes more specialized

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
Thanks for your persistence.

What I also want to avoid is effectively having multiple copies of the same file but I think I have just twigged to another possibility - I could just use a #include within the dealer's web page! So his home page would look something like:
Code:
<%DealerId=1267%>
<!--#include file="mastersite\GenerateDealerPage.asp" -->
I think that would give me exactly what I need. Code within the include file would look up the database on the dealer id and generate the appropriate page content. Does that make sense?
 
perfect sense.. give it a go

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top