Difficult one(?)

Results 1 to 2 of 2

Thread: Difficult one(?)

  1. #1
    Join Date
    Dec 1969

    Default Difficult one(?)

    Ok, here´s what i gott to do:<BR><BR>The are tree diffrent computers involved here:<BR>1. The Webserver, a standard webserver<BR>2. The local webserver, a local webserver at a company<BR>3. A computer with a administration-program controlled by API´s.<BR><BR>The thing is that on the webserver (#1) a person is gona request some info, let´s say how many toys the company got home. this information is in the Computer (#3) with the admin-program.<BR><BR>So I got to send the request from the webserver (#1) to the local webserver (#2) so that server can execute the correkt API´s and get out the information from the admin-program and send it back to the webserver (#1) so it can be presented to the person.<BR><BR>What I want to know of anyone has done this kinda thing before, or if there are some sort of known technic´s for doing it.<BR><BR>Any hints will be appriciated.

  2. #2
    omalleyb Guest

    Default RE: Difficult one(?)

    The same code can reside on each server, just ask what server you&#039re at each time and forward all requests to wherever it is they should be sent. The name of my &#039baseserver&#039 below is in an include file as a variable. The name of the server you&#039re at each time you hit this page is orig_server. How to get home is stored in back_to. The function stripURL() is in another include file - it strips the first and last parts of the current URL to extract the filepath minus server name to left and file name to right of string. All variables needed are shared through the URL querystring (some must be URLEncoded though). G&#039Luck - any probs email:<BR>brian@esmart.ie<BR><BR><BR>origin_server = request.servervariables("SERVER_NAME")<BR> new_file_loc = Request.ServerVariables("SCRIPT_NAME")<BR> file_path = StripURL(Request.ServerVariables("SCRIPT_NAME"))<B R> <BR> &#039 The base server, with local database connection, is compared against<BR> &#039 the server dealing with the current request.<BR> &#039 If not similar then request is forwarded to base server.<BR> IF (origin_server &#060;&#062; base_server) THEN<BR> back_to = "back_to=http://" & origin_server & file_path<BR> Response.Redirect("http://" & base_server & new_file_loc & "?" & back_to)<BR> ELSE<BR> &#039 Disable caching<BR> Response.Expires=0<BR> <BR> &#039 You&#039re at the right server, do your stuff here <BR><BR> &#039 And now - to get home again to original server...<BR> IF Request("back_to") &#060;&#062; "" THEN<BR> Response.Redirect(Request("back_to") & "/print.asp?UserEmail=" & userEmail)<BR> ELSE<BR> userEmail = Server.URLEncode(userEmail)<BR> gonext = Request.ServerVariables("SCRIPT_NAME") & "?UserEmail=" & userEmail<BR> Response.Redirect(gonext)<BR> END IF

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts