473,246 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,246 software developers and data experts.

How to point to other URL's with #include command?

Hello all,

I've used the SSI Include command successfully in the past to include
frequently used files that are based within my own site. However, what
if I was to use a file located in a differnt location - a different
site altogether?

I've Googled different variations of "how to insert an URL using
#include" but all of the sites that came up never got beyond "file="
and "virtual=". There may be no more to it that that, but I'm not
sure.

I've tried <!--#include file="http://blahblahblah.com/filename.txt" -->
and other variations of that using CSS style "url('')" and "a href=",
but have gotten nowhere. Can this be done with the #include command? If
so, how?

The intended use is: I have someone who wants to add a schedule to a
website. The schedule will change frequently, causing a major hassle
for me. Ideally, I would have that person upload the file to their own
folder on the internet, and I would link to that file with the include
command, displaying the contents on the web page.

Thanks in advance.

Viken K.

Jan 31 '06 #1
5 4016
Viken Karaguesian wrote:
Hello all,

I've used the SSI Include command successfully in the past to include
frequently used files that are based within my own site. However, what
if I was to use a file located in a differnt location - a different
site altogether?

I've Googled different variations of "how to insert an URL using
#include" but all of the sites that came up never got beyond "file="
and "virtual=". There may be no more to it that that, but I'm not
sure.

I've tried <!--#include file="http://blahblahblah.com/filename.txt" -->
and other variations of that using CSS style "url('')" and "a href=",
but have gotten nowhere. Can this be done with the #include command? If
so, how?


No. The #include directive reads a file, it doesn't request a document
over the web. The server would also have to be a web client! So the
#include directive doesn't have that functionality.

If you're using ASP under IIS, you can use the WinHTTPServerRequest
ActiveX object to request the off-site page through code and write the
data returned out to the client. Other server-side technologies on other
web servers might provide a similar facility.
Jan 31 '06 #2
> No. The #include directive reads a file, it doesn't request a document
over the web. The server would also have to be a web client! So the
#include directive doesn't have that functionality.

Thanks Harlan. I've searched page after page in Google and hadn't found
any references to that, so I was coming to that conclusion on my own.

An better solution would be to provide her with a folder on the
webhost's server, give her a user name and password and have her copy
the file to that folder. Then I can link to the file from within the
site.

Don't know why I didn't think of that before...

Thanks for the reply.

Viken K.

Jan 31 '06 #3
On 31 Jan 2006 10:10:05 -0800, "Viken Karaguesian" <vi****@aol.com>
wrote:
I've used the SSI Include command successfully in the past to include
frequently used files that are based within my own site. However, what
if I was to use a file located in a differnt location - a different
site altogether?
It doesn't (stretching a point) have to be a file on the same _site_,
but it must be on the same filesystem that the web server uses.

Files, and especially include files, are quite a low-level part of the
web architecture and they're tightly coupled to how the server operates.
It should not have to read them every time the page is served, but it
must be able to tell when they've been changed (so it can include the
new version). Generally a good server will do the merging once, then
cache the merged copy until something changes.

So if you separate the web server from its include files, then you're
making life very difficult for the server. This is why you can only
process includes from a "file" attribute or a "virtual" attribute which
maps onto a local file, but there's no "web address" or "href"
attribute.

There are several options for you.

* <iframe>
This is the closest to "include files over the web", but it's done on
the client (web browser) side. It has drawbacks. You'll also need the
content author to have their own full-powered web hosting.

* Upload to your server.
Have the author make the file on their desktop machine, then upload it
(by ftp, or more sophisticated means) to your web server. Good hosting
packages allow you to create restricted ftp accounts that only access
subdirectories, which are ideal for this. This is probably the best
solution.

* Weblog
Install some simple weblogging software on your server, configure it to
turn nearly all features off, then let the content author be the one
user who can make postings to it. This is a good solution if the
content author is not technically expert - remember that an error in
their content might break a lot of your site!

Ideally, I would have that person upload the file to their own
folder on the internet, and I would link to that file with the include
command, displaying the contents on the web page.


What's a "folder on the internet" ? Do they have web hosting of their
own, and does it have adequate capacity for this purpose ? If they can
upload to "their folder", then they can probably upload to a directory
on your server just as easily.
Jan 31 '06 #4
> * Upload to your server.
Have the author make the file on their desktop machine, then upload it
(by ftp, or more sophisticated means) to your web server. Good hosting
packages allow you to create restricted ftp accounts that only access
subdirectories, which are ideal for this. This is probably the best
solution.
This is exactly what I plan to do. I don't know why I didn't think of
it before. See my reply to Harlan.
What's a "folder on the internet" ? Do they have web hosting of their
own, and does it have adequate capacity for this purpose ?


Many ISP's, like mine (Comcast) offer "personal web spaces" with their
accounts. This is a folder that you can put a website in or just put
files for you and others to access. She has Comcast, so she as a folder
to which she can upload. But the previously mentioned solution is
better.

Thanks.

Viken K.

Jan 31 '06 #5
Viken Karaguesian wrote:
Hello all,

I've used the SSI Include command successfully in the past to include
frequently used files that are based within my own site. However, what
if I was to use a file located in a differnt location - a different
site altogether?

I've Googled different variations of "how to insert an URL using
#include" but all of the sites that came up never got beyond "file="
and "virtual=". There may be no more to it that that, but I'm not
sure.


There are ways to do that. In Apache, mod_publisher gives you
<!--#include url="..."-->. Or an ESI processor will do an
essentially-equivalent job.

Whatever you use, make sure you have some sensible cacheing
regime on your server, so you're not fetching something by HTTP
on every hit.

--
Nick Kew
Feb 1 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: TNGgroup | last post by:
Hi, I have some troubles with the correct syntax, hope to get some help. This is the intention: This is the code I'd like to use. url: http://webserver/ta.asp?artnr=04001 Code ta.asp:...
4
by: Roger Leigh | last post by:
Hello, I'm writing a fixed-precision floating point class, based on the ideas in the example fixed_pt class in the "Practical C++ Programming" book by Steve Oualline (O' Reilly). This uses a...
5
by: Anton Noll | last post by:
We are using Visual Studio 2003.NET (C++) for the development of our software in the fields digital signal processing and numerical acoustics. One of our programs was working correctly if we are...
2
by: aj | last post by:
DB2 WSE 8.1 FP5 Linux Red Hat 2.1 AS I am using a new more secure password for my instance owner account, one which has an exclamation point in it. Using CC, when I try to import or export or...
5
by: juergen perlinger | last post by:
Hello out there. sometimes I need to have proper control of the floating point arithmetic of the C(and C++) runtime system, and using the f.p. exception handling of the C99 standard is quite...
2
by: devendra pardeshi | last post by:
hi friends/seniors i am stuck on one problem in VB 6.0 and need solution. see if u can help me. first i describe the problem. Can u imagin the WinZip scenario. we right click on some file...
5
by: ME | last post by:
What is the fastest way of getting the fraction part of a floating point number? So, if I have a float 10.3 I want to get a float with value 0.3 fast. Thanks
1
by: John | last post by:
Can some one please help me with this code? I've spend 2 days on it. And I see the question all over the place but I do not see the answer. No on is answering the question I am about to ask. I...
10
by: strife | last post by:
Hey everyone, I was making a program for a class, and I ran into a problem that is driving me crazy. I first suspected Vista, and since I am not home I cannot verify if it just my Vista...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.