Click to See Complete Forum and Search --> : Pulling text from one file into another


dangerous
01-06-2005, 07:25 PM
Is there a way to pull text from a page into a page on another server. I am under the impression Server Side Includes can only do this on the same file structure. Is there something else that can pull a text file (one or two sentences in an .txt file) via it's full url path?? Thanks!!

Charles
01-06-2005, 07:41 PM
SSI allows you to include the output from scripts. So if you have Perl available and the LWP and CGI modules installed you might use the SSI command:

<!--#include virtual="/cgi-bin/include.pl" -->

to grab the output from some script named "include.pl" that looks like:

#!user/local/bin/perl

use CGI qw(header);
use LWP::Simple;

print header, get 'http://www.w3.org/';

dangerous
01-06-2005, 07:56 PM
This is on a windows server where activestate perl is NOT loaded.

ETA: I'm trying to create an easy avenue for a client to update a page by themselves. They have their own webserver where their .txt file will be located but the page they are updating will be on a Windows webserver I access. This arrangement can't be altered.

Charles
01-06-2005, 08:26 PM
Originally posted by dangerous
This is on a windows server where activestate perl is NOT loaded.

ETA: I'm trying to create an easy avenue for a client to update a page by themselves. They have their own webserver where their .txt file will be located but the page they are updating will be on a Windows webserver I access. This arrangement can't be altered. Well then, What scripting does your server support?

dangerous
01-07-2005, 09:07 AM
Originally posted by Charles
Well then, What scripting does your server support?

I hate to give this answer but I don't know. I work at a company and it's a corporate run server with little to no support but I also don't have admin priveleges for it. I can try something out to see if it works. I've used Perl quite extensively on a UNIX server in past so I already know Activestate is not loaded on this one and they won't load it for me.

Is there something else you can suggest for automaticly updating a website for non-developers? They can place text documents in a repository that will produce a URL or I can create some interface for them to do it directly on the server (via an html page). Thanks!

Charles
01-07-2005, 03:11 PM
Teach them HTML. Real HTML that is; the semantic kind. You work up the template with all of the presentation in external CSS files and then let them edit the HTML side directly. You'll want them to submit the files to you the first couple of times so that you can be sure that they are marking up content and not presentation but soon they'll be all grown up and handling things by themselves.

dangerous
01-07-2005, 03:28 PM
Originally posted by Charles
Teach them HTML. Real HTML that is; the semantic kind. You work up the template with all of the presentation in external CSS files and then let them edit the HTML side directly. You'll want them to submit the files to you the first couple of times so that you can be sure that they are marking up content and not presentation but soon they'll be all grown up and handling things by themselves.

They're not developers and have jobs that keep them busy 60+ hours a week already.

I did find an asp script that works on a 2003 server but barfs on a win2k one. Any idea why?

<%
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", "http://someremotesite.com/somefile.txt", false
objHTTP.Send
Response.Write objHTTP.ResponseText
%>

IncaWarrior
01-07-2005, 04:31 PM
Try MSXML2.ServerXMLHTT for the object you're creating.