Help me with this HTML problem!

Brian23

Banned
Dec 28, 1999
1,655
1
0
ok, I have a html file that has text on it (file B). And then there is another html file that has a table in it. (file A). I'm trying to figure out how to make it when the web browser loads file A, the table in file A will be filled with the text in file B. Is this possible? And how do I do it?
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
You could do it with SHTML and server-side includes. That'd be the best way, I think.

Rob
 

bmd

Golden Member
Feb 17, 2001
1,043
0
0
Any good ASP primers/guides out there? I'm googling it as we speak, just curious if anyone had a specific recommendation.
 

Brian23

Banned
Dec 28, 1999
1,655
1
0
Thanks for the help guys, I was hoping that someone could give me a simple syntax to do this, but I'm sure it's not that complicated. I'll figure it out.
 

Maverick2002

Diamond Member
Jul 22, 2000
4,694
0
0
It's not difficult at all. If you're using ASP, convert all pages/include files to have a .asp extension. So now you have pageA.asp (the page with the table in it) and pageB.asp (the contents inside the table). Your code will look something like this (assume pageB.asp is located in the parent directory).

<html>
<head>
header stuff
</head>
<body>
body stuff
<table blah blah table specs>
<tr>
<td>

<!--#include file="pageB.asp"-->

</td>
</tr>
</table>
more stuff
</body>
</html>

That's all there's to it. If you're using SSI (server side includes), the pages need to be renamed to .shtml, and the text file can be .txt. Then the code looks something like this:

<!--#virtual include="pageB.txt"-->
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Originally posted by: Maverick2002
It's not difficult at all. If you're using ASP, convert all pages/include files to have a .asp extension. So now you have pageA.asp (the page with the table in it) and pageB.asp (the contents inside the table). Your code will look something like this (assume pageB.asp is located in the parent directory).

<html>
<head>
header stuff
</head>
<body>
body stuff
<table blah blah table specs>
<tr>
<td>

<!--#include file="pageB.asp"-->

</td>
</tr>
</table>
more stuff
</body>
</html>

That's all there's to it. If you're using SSI (server side includes), the pages need to be renamed to .shtml, and the text file can be .txt. Then the code looks something like this:

<!--#virtual include="pageB.txt"-->
Shouldn't the SSI code look like this?

<!--#include virtual="/whatever/pageB.txt" -->

(if you are using a path)

or:

<!--#include file="pageB.txt" -->

That's how the syntax works for me, at least.

Rob
 

Beau

Lifer
Jun 25, 2001
17,730
0
76
www.beauscott.com
Originally posted by: Entity
Shouldn't the SSI code look like this?

<!--#include virtual="/whatever/pageB.txt" -->

(if you are using a path)

or:

<!--#include file="pageB.txt" -->

That's how the syntax works for me, at least.

Rob

<!--#VIRTUAL file="whatever.asp"--> is used for files that are mapped through virtual directories, or directories relative to the web address.
<!--#include file="pageB.txt" --> is used for files with a path relative to the file system.
 

BigJohnKC

Platinum Member
Aug 15, 2001
2,448
1
0
You could do it with javascript, too, but it gets really complicated. I've seen an example, though, where the page had a dynamic table that took source from an external XML file and loaded into the table. But the asp thing is much easier, if your webserver is IIS. If not, there's a similar way to do it with perl/CGI, and probably also php.
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Originally posted by: Beau6183
Originally posted by: Entity
Shouldn't the SSI code look like this?

<!--#include virtual="/whatever/pageB.txt" -->

(if you are using a path)

or:

<!--#include file="pageB.txt" -->

That's how the syntax works for me, at least.

Rob

<!--#VIRTUAL file="whatever.asp"--> is used for files that are mapped through virtual directories, or directories relative to the web address.
<!--#include file="pageB.txt" --> is used for files with a path relative to the file system.
Yeah, I don't know ASP at all, but I know for SSI that both:
<!--#include virtual="/biostat/mainindex.shtml" -->
<!--#include file="mainpage.shtml" -->

will work, because they are for me. :p

Rob
 

Beau

Lifer
Jun 25, 2001
17,730
0
76
www.beauscott.com
Originally posted by: Entity
Originally posted by: Beau6183
Originally posted by: Entity
Shouldn't the SSI code look like this?

<!--#include virtual="/whatever/pageB.txt" -->

(if you are using a path)

or:

<!--#include file="pageB.txt" -->

That's how the syntax works for me, at least.

Rob

<!--#VIRTUAL file="whatever.asp"--> is used for files that are mapped through virtual directories, or directories relative to the web address.
<!--#include file="pageB.txt" --> is used for files with a path relative to the file system.
Yeah, I don't know ASP at all, but I know for SSI that both:
<!--#include virtual="/biostat/mainindex.shtml" -->
<!--#include file="mainpage.shtml" -->

will work, because they are for me. :p

Rob


/me smacks forehead...

Duh... I really need to read more carefully.