Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP Include
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASP Include

 Post Reply Post Reply
Author
twooly View Drop Down
Groupie
Groupie


Joined: 24 September 2003
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote twooly Quote  Post ReplyReply Direct Link To This Post Topic: ASP Include
    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 "-->
%>

 

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



Edited by twooly
Back to Top
twooly View Drop Down
Groupie
Groupie


Joined: 24 September 2003
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote twooly Quote  Post ReplyReply Direct Link To This Post 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", 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
%>

Back to Top
twooly View Drop Down
Groupie
Groupie


Joined: 24 September 2003
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote twooly Quote  Post ReplyReply Direct Link To This Post 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.  If someone could point me in the right direction I would appreciate it.

 

Thanks

--Todd 

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
twooly View Drop Down
Groupie
Groupie


Joined: 24 September 2003
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote twooly Quote  Post ReplyReply Direct Link To This Post 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

 

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

Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2003 at 3:35pm
str = objXML.responseText
str = replace(str,"src=","src=http://www.server/")
response.write str
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.