.asp in FP2002

A

Alex

Problem:
1. In a link I call abc.asp?param=XX -it works fine with
several fields retrieved from database.
2. Inside the abc.asp (at the top of the page) I need to
include a XX.htm file with some pictures in a table (done
by an artist so it have to be that way!)
The problem is that this file is to be XX.htm where XX is
the value in the param in p. 1 above.
How do I do that. Tried SSI but can't fix it.
Any suggestion will be appreciated.
Greetings from Copenhagen
Alex
 
J

Jim Buyens

-----Original Message-----
Problem:
1. In a link I call abc.asp?param=XX -it works fine with
several fields retrieved from database.
2. Inside the abc.asp (at the top of the page) I need to
include a XX.htm file with some pictures in a table (done
by an artist so it have to be that way!)
The problem is that this file is to be XX.htm where XX is
the value in the param in p. 1 above.
How do I do that. Tried SSI but can't fix it.
Any suggestion will be appreciated.

I think you'll need to write some ASP code that opens the
XX.htm file on the server, picks out the portion between
the <body> and </body> tags, and writes it into the
response stream.

Here's some sample code, which I'm typing cold so excpect
a few bugs. Also, it dods *no* error checking.

<%
dim fso
dim xxfile
dim xxhtm
dim begpos
dim endpos

set fso = server.createobject("scripting.filesystemobject")
set xxfile = fso_OpenTextFile( _
server.mappath(request("param") & ".htm"),1) ' 1=read
xxhtm = xxfile.ReadAll()
begpos = instr(lcase(xxhtm),"<body>") + 6
endpos = instr(lcase(xxhtm),"</body>")
response.write mid(xxhtm, begpos, endpos - begpos)
xxfile.close
%>

Jim Buyens
Microsoft FrontPage MVP
(e-mail address removed)
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top