473,387 Members | 1,771 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,387 software developers and data experts.

Possible to include SSI in ASP page using full URL?

Hi,

We want to include some SSI in our ASP pages, but where the SSI is
located on a different server, and so we need to be able to access the
SSI using a full URL, as opposed to a local file reference or relative
URL.

The "include" apparently doesn't allow this, so I was wondering if
anyone knows away to accomplish this?

Thanks!

Jim
Oct 7 '08 #1
7 2929
Gazing into my crystal ball I observed ohaya <oh***@cox.netwriting in
news:05**********************************@q26g2000 prq.googlegroups.com:
Hi,

We want to include some SSI in our ASP pages, but where the SSI is
located on a different server, and so we need to be able to access the
SSI using a full URL, as opposed to a local file reference or relative
URL.

The "include" apparently doesn't allow this, so I was wondering if
anyone knows away to accomplish this?

Thanks!

Jim
AFAIK, there is no way to do this other than XMLHTTP or maybe an Iframe
(frowned upon, however).

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Oct 7 '08 #2
Adrienne Boswell wrote:
Gazing into my crystal ball I observed ohaya <oh***@cox.netwriting in
news:05**********************************@q26g2000 prq.googlegroups.com:
>Hi,

We want to include some SSI in our ASP pages, but where the SSI is
located on a different server, and so we need to be able to access the
SSI using a full URL, as opposed to a local file reference or relative
URL.

The "include" apparently doesn't allow this, so I was wondering if
anyone knows away to accomplish this?

Thanks!

Jim

AFAIK, there is no way to do this other than XMLHTTP or maybe an Iframe
(frowned upon, however).

Adrienne,

Thanks for the pointer re. XMLHttp. That *almost* did it, but
unfortunately, not quite :(...

I'm doing the XMLHttp call on the server-side, in an ASP page, and I was
able to GET the SSI using XMLHttp, but, the SSI includes links for
images and for css.

The images on the final page are appearing as "red X'es".

When I did view source on the final page, it looks like it's using my
hostname as the hostname in the URLs that it's using to GET the images.

In other words, the SSI has something like:

<IMG src="/icons/brand.gif"...

but on the final page served/view source it has:

<IMG src="http://myhost/icons/brand.gif"...

I can't really tell, but I think the same thing is happening with the
references/links for the css that is in the SSI that I'm getting.

Is there a way to resolve this problem?

Maybe in my ASP, I can parse the hostname part of the image and css URLs
before doing the Response.Write?

Would that work??

Any other ideas?

Jim
Oct 8 '08 #3
ohaya wrote:
Adrienne,

Thanks for the pointer re. XMLHttp. That *almost* did it, but
unfortunately, not quite :(...

I'm doing the XMLHttp call on the server-side, in an ASP page, and I
was able to GET the SSI using XMLHttp, but, the SSI includes links for
images and for css.

The images on the final page are appearing as "red X'es".

When I did view source on the final page, it looks like it's using my
hostname as the hostname in the URLs that it's using to GET the
images.

In other words, the SSI has something like:

<IMG src="/icons/brand.gif"...

but on the final page served/view source it has:

<IMG src="http://myhost/icons/brand.gif"...

I can't really tell, but I think the same thing is happening with the
references/links for the css that is in the SSI that I'm getting.

Is there a way to resolve this problem?

Maybe in my ASP, I can parse the hostname part of the image and css
URLs before doing the Response.Write?
Do you have any control over that remote page so you can change those
relative links to absolute links? If not, you will have to parse and
replace the relative links with absolute links.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Oct 8 '08 #4
Bob Barrows [MVP] wrote:
ohaya wrote:
>Adrienne,

Thanks for the pointer re. XMLHttp. That *almost* did it, but
unfortunately, not quite :(...

I'm doing the XMLHttp call on the server-side, in an ASP page, and I
was able to GET the SSI using XMLHttp, but, the SSI includes links for
images and for css.

The images on the final page are appearing as "red X'es".

When I did view source on the final page, it looks like it's using my
hostname as the hostname in the URLs that it's using to GET the
images.

In other words, the SSI has something like:

<IMG src="/icons/brand.gif"...

but on the final page served/view source it has:

<IMG src="http://myhost/icons/brand.gif"...

I can't really tell, but I think the same thing is happening with the
references/links for the css that is in the SSI that I'm getting.

Is there a way to resolve this problem?

Maybe in my ASP, I can parse the hostname part of the image and css
URLs before doing the Response.Write?

Do you have any control over that remote page so you can change those
relative links to absolute links? If not, you will have to parse and
replace the relative links with absolute links.

Rob,

Sorry, I forgot to answer your question directly. "No", we don't have
direct control over the content in the SSI. The SSI content is under
control of a different group, and is a kind of centralized resource in
our organization.

Jim
Oct 9 '08 #5
ohaya wrote:
Rob,

Sorry, I forgot to answer your question directly. "No", we don't have
direct control over the content in the SSI. The SSI content is under
control of a different group, and is a kind of centralized resource in
our organization.
No worries: I assumed that was the case given your decision to parse/edit
the urls.

--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Oct 9 '08 #6
"ohaya" <oh***@cox.netwrote in message
news:OU**************@TK2MSFTNGP04.phx.gbl...
ohaya wrote:

I have:
<%
If value_found = True Then
Dim xml_header
Set xml_header = Server.CreateObject("Microsoft.XMLHTTP")
xml_header.Open "GET", value & "/ssi/header.ssi", False
xml_header.Send 'do the HTTP GET

Dim xyz_header
xyz_header = xml_header.responseText
Response.Write xml_header.responseText
Response.flush
Set xml_header = Nothing
End If

Hopefully, this'll continue to be consistent.
Response.flush is changing the timing of delivery. Ordinarily
Response.Writes just fill a local buffer and only after the script is
finished is the entire buffer sent to the client. With Response.Flush you
are sending content earlier giving the browser a chance to render what has
been sent so far. However the final HTML delivered should be the same so
the browser ought to be presenting the same result.

BTW, You should not be using Microsoft.XMLHTTP in ASP, use
MSXML2.ServerXMLHTTP.3..0 which is designed to be used in such Server based
scenarios.

--
Anthony Jones - MVP ASP/ASP.NET

Oct 10 '08 #7
Anthony Jones wrote:
"ohaya" <oh***@cox.netwrote in message
news:OU**************@TK2MSFTNGP04.phx.gbl...
>ohaya wrote:

I have:
<%
If value_found = True Then
Dim xml_header
Set xml_header = Server.CreateObject("Microsoft.XMLHTTP")
xml_header.Open "GET", value & "/ssi/header.ssi", False
xml_header.Send 'do the HTTP GET

Dim xyz_header
xyz_header = xml_header.responseText
Response.Write xml_header.responseText
Response.flush
Set xml_header = Nothing
End If

Hopefully, this'll continue to be consistent.

Response.flush is changing the timing of delivery. Ordinarily
Response.Writes just fill a local buffer and only after the script is
finished is the entire buffer sent to the client. With Response.Flush
you are sending content earlier giving the browser a chance to render
what has been sent so far. However the final HTML delivered should be
the same so the browser ought to be presenting the same result.

BTW, You should not be using Microsoft.XMLHTTP in ASP, use
MSXML2.ServerXMLHTTP.3..0 which is designed to be used in such Server
based scenarios.

Anthony,

Thanks. We'll take a look at MSXML2.ServerXMLHTTP.

Jim
Oct 10 '08 #8

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

Similar topics

7
by: Mr B | last post by:
Howdy, I want to set up an Include page in a cell of a table. Then I want to be able to change which page is included on the fly as the user moves the mouse of the various links on the page. ...
11
by: Eric Osman | last post by:
Let's say I want to filter the contents of a target web page, and present a simpler page on the screen. For example, let's say a target web page is full of links, text, images, forms, etc. and...
2
by: Bad_Kid | last post by:
Is it possible to print a page that has no "title" and "page number" on the top and no "link adress" and "date" on the bottom (to print just a page just as it is...)? (how, thanks!)
2
by: Shiju Poyilil | last post by:
what is the difference between UserControl and Include Page . Rgds Shiju
1
by: Jozef | last post by:
Hello, Is there a trick to using a vbscript / SQL server field value for an include page line? The SQL Server field "tContentPage" contains a text value "test.asp" I am trying to call this...
3
by: Dave | last post by:
I have different database connections that I use for DEV and PROD versions of our web app. I want to put the database connection string in one location so I only have to change it once when we...
3
by: =?Utf-8?B?QnJhbmRvbg==?= | last post by:
Hi, I have an aspx page that has the "include" code in it which includes another page that displays information. I also have an upload page that allows users to upload a simple html document...
7
by: kigoobe | last post by:
Hi guys I am trying to get the full url of a page using php. The url looks like -> http://www.example.com/list.php?type=event&p=5|14#2 The issue is, I am getting everything except the part...
5
Soniad
by: Soniad | last post by:
Hello, I want to include asp file within vbscript, this file name i am taking in variable . and when i use this variable in the include tag outside delimiters(<%%>), it does not work, <%Dim...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.