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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open an htm document on a different server

Status
Not open for further replies.

B827

Technical User
Feb 14, 2002
281
GB
I have a requirement to open an html format document which is not on my Intranet server using code. The reason for this is we have multiple sites and want people to open the document on a local sever to keep network traffic down.

I can do this using the following link on a page

<a href=&quot;\\Server\Folder\Subfolder\document.htm&quot;>Open window</a>

but I would like to do this automatically using some asp code.

I know where the person is accessing the page from by using Request.ServerVariables(&quot;REMOTE_HOST&quot;) so it should be easy but I can't find anything to do this.

ANY help, hints or ideas would be very welcome.

Many thanks in advance

Sandy
 
response.redirect &quot;path&quot;?

Known is handfull, Unknown is worldfull
 
thanks for the quick response vbkris-

I should have said I get a

The page cannot be found

error when I use response.redirect

Sandy
 
Hi Sandy, Can you show us the construct of the string in the transfer path? Sounds like something is just not getting concat'd correctly or a value is not coming out right. either that or write the string tot he screen to see if it is valid.


_________________________________________________________
$str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
$Nstr = ereg_replace(&quot;sleep&quot;,&quot;coffee&quot;,$str); echo $Nstr;

onpnt2.gif
[/sub]
 
Hello onpnt
I am using the following:

Select Case Trim(Left(Request.ServerVariables(&quot;REMOTE_HOST&quot;),11))

to give me nnn.nnn.nnn for the server being used to access the page
then I use

Case &quot;123.456.789&quot;
Response.Redirect &quot;\\Server\Folder\subfolder\page.htm&quot;
Case &quot;987.654.321&quot;
Response.Redirect &quot;\\Server2\Folder\subfolder\page.htm&quot;
.
.
.
End Select

Apart from the server name the location string is the same for each location.

This fails to find the page but using a link on the page

<a href=&quot;\\Server\Folder\Subfolder\document.htm&quot;>Open window</a>

works fine.

Many Thanks

Sandy
 
try some debug if not already.
Response.Write Trim(Left(Request.ServerVariables(&quot;REMOTE_HOST&quot;),11))

Case &quot;123.456.789&quot;
Response.Write &quot;Case Match 123.456.789&quot;
Response.Redirect &quot;\\Server\Folder\subfolder\page.htm&quot;

also, a change to server.transfer may be something to give a shot


_________________________________________________________
$str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
$Nstr = ereg_replace(&quot;sleep&quot;,&quot;coffee&quot;,$str); echo $Nstr;

onpnt2.gif
[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top