Print Page | Close Window

ASP Include

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6853
Printed Date: 31 March 2026 at 3:06pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP Include
Posted By: twooly
Subject: ASP Include
Date Posted: 30 October 2003 at 1:34pm

Not sure if you can do this so thought I would ask.  Is it possible to include an external site in an asp file.

Example

<%
<!--#include file =" http://server:80/HPOV_IOPS/cgi-bin/Analyzer.exe?GRA PHTEMPLATE=CODA&GRAPH=Overall+CPU&GROUP=%5bITO%5dWLE +Servers&DATERANGE=1+Hour&POINTSEVERY=5+min&GRAP HSIZE=medium&SYSTEMNAME=server%2estipn%2ecom&am p;SYSTEMNAME&DRAWGRAPH=Draw+Graph&CUSTOMER=All+Custo mers&PASSWORD&SKIN&FORMTEMPLATE=VPI%5fFormTempla te%2etxt&NUMBEROFMETRICLINES=1&onLYNonDSN=1 - http://server:80/HPOV_IOPS/cgi-bin/Analyzer.exe?GRA PHTEMPLATE=CODA&GRAPH=Overall+CPU&GROUP=%5bITO%5dWLE +Servers&DATERANGE=1+Hour&POINTSEVERY=5+min&GRAP HSIZE=medium&SYSTEMNAME=server%2estipn%2ecom&am p;SYSTEMNAME&DRAWGRAPH=Draw+Graph&CUSTOMER=All+Custo mers&PASSWORD&SKIN&FORMTEMPLATE=VPI%5fFormTempla te%2etxt&NUMBEROFMETRICLINES=1&ONLYNONDSN=1 "-->
%>

 

Basicly I am trying to setup some pages where management can go to see real time stats without having to fill in a form

 

Thanks

--Todd




Replies:
Posted By: twooly
Date Posted: 30 October 2003 at 1:48pm

Got it figured out

<%
  Response.Buffer = True
  Dim objXMLHTTP, xml

  ' instantiate the XMLHTTP OBJECT :
  Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
 
 'or you can use
  ' Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")

  ' open a connection to a remote website.
  objXML.Open "GET", " http://www.abcdefghijklmnop.com/ - http://www.abcdefghijklmnop.com ", False
     
  ' sends the request and returns the data:
  objXML.Send

  'Display the HTML both as HTML and as text
  Response.Write "<h1>HTML TEXT</h1><xmp>"
  Response.Write objXML.responseText
  Response.Write "</xmp><p><hr><p><h1>HTML PAGE</h1>"

  Response.Write objXML.responseText
 
 
  Set objXML = Nothing
%>



Posted By: twooly
Date Posted: 30 October 2003 at 2:47pm

Ok the above works great except images.  Since the page I am pulling with only uses "images/image.gif".  How can I look in the code and change the line "images/image.gif" to http://server/images.gif - http://server/images.gif .  If someone could point me in the right direction I would appreciate it.

 

Thanks

--Todd 



Posted By: michael
Date Posted: 30 October 2003 at 2:51pm
Depending on how you reference your includes, reference images in there as <img src="/images/image.gif"> This way it is always referenced from the root

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Gullanian
Date Posted: 30 October 2003 at 3:04pm
Or you could run a function on the output before its displayed replacing all src=" with src="www.


Posted By: twooly
Date Posted: 30 October 2003 at 3:05pm

I guess the problem is my page is on a different server than where the image is being put so I need to change images/image.gif to http://server/images/image.gif - http://server/images/image.gif

 

So my question is how can I modify the code using the function above? "objXML.responseText" 



Posted By: Gullanian
Date Posted: 30 October 2003 at 3:35pm
str = objXML.responseText
str = replace(str,"src=","src=http://www.server/")
response.write str



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net