Web Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 13th, 2004, 07:18 AM
mcai7gh2 mcai7gh2 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: UK
Posts: 2 mcai7gh2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Including External Web Content

Hi,

I need to be able to include some data (which is in a text file) from another server and display it on my webpage. I need to do this as this text file is updated, and I would like it to update my site at the same time. What is the best way of doing this? I have tried using a server side include and that did not work , so I guess it is not possible to do that. Has anyone got any ideas?

Best Wishes

G

Reply With Quote
  #2  
Old December 13th, 2004, 09:25 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
Are you using a specific server side language?
Some languages have ways of accessing web documents (text, html, etc) via HTTP.

If your other server is on the local network, and not a webserver, you can usually access the file with an absolute path.

If nothign works, check that you have proper permissions to access the file.

Reply With Quote
  #3  
Old December 13th, 2004, 09:33 AM
mcai7gh2 mcai7gh2 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: UK
Posts: 2 mcai7gh2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by MadCowDzz
Are you using a specific server side language?
Some languages have ways of accessing web documents (text, html, etc) via HTTP.

If your other server is on the local network, and not a webserver, you can usually access the file with an absolute path.

If nothign works, check that you have proper permissions to access the file.

We have ISS on the server I am trying to pull the data from and too. I can use HTML, Javascript, VBScript or ASP to implement this, but I am not sure what is the best way of doing it.

Both servers are web servers.

I can read the file via a browser.

Reply With Quote
  #4  
Old January 20th, 2005, 05:13 PM
altan altan is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 altan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 6 sec
Reputation Power: 0
Hi, you can not use "include file" for pages on two different servers. Here is a simple solution with asp. Call getcontent.asp, to get the content of the page from other server. Then save it as a text file (content.txt). And include file content.txt in the page thaet you will display (display.asp). Also, you can read the contents of content.txt with file system object and then send it to the browser with response.write command.

Getcontent.asp
<%
Dim FSO, TextStream
Dim url, strContent
Dim objXMLHTTP, xml
Set FSO = Server.CreateObject("Scripting.FileSystemObject")

url = "http://my.otherserver.com/mytextfile.txt
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", url, False
xml.Send
strContent = xml.responseText
Set xml = Nothing

Set TextStream = FSO.OpenTextFile(Server.MapPath("content.txt"), 2, True)
TextStream.Write(strContent)
TextStream.Close
Set TextStream = Nothing
Set FSO = Nothing
%>

Display.asp
<%
...
...
%>
<!-- #include file="content.txt"-->
<%
...
...
%>

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Development > Including External Web Content


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT