C
Colin Mc Mahon
Hi all,
I am currently using a system you are probably familiar with if you have
done any templating with vbscript, define a template file with special
tokens in it(like ##Content## etc), load the file and replace these with
strings on each page. This works well but means on some pages there are vast
string concatenations to make up the content areas etc.
I had a bit of a brainwave and started rewriting my templating functions to
support 2 files, the template file and the content file. The template is
loaded via the fso, and some tokens are replaced, then I load the content
file via Msxml2.ServerXMLHTTP which allows me to execute vbscript in the
other file. I then have one page to which all page requests are sent(eg
default.asp?url=/home.asp) which loads the template and loads the requested
content file then merges both. This worked well until I started trying to
integrate it into my CMS!
The immediate problem was users login could not be read from session by the
xmlhttp loaded content page (guessing these pages are considered a different
session), but this can be got around by writing actual cookies rather than
Session vars only, or by maintaining a 'current users' table in the site
database and passing a user token back and forth.
Next prob was querystrings, but I can request these from the 'container' and
pass them down into the second page via Msxml2.ServerXMLHTTP get requests.
The big problem I have hit is forms, i can't think how to pass forms to the
second page, obviously get requests aren't a problem, but I can't change all
my forms to get since the quantity of info in some would kill the
querystring, I also have some multipart/form-data forms that i haven't a
clue how to pass.
The only inkling of an idea I have is to intercept all qstrings/posted data
at the container level into a custom collection and then to pass these to
the secondary page in some way. It's the 'some way' i'm not so sure about
I suppose my questions are:
1) Is this approach used out there? If so any performance issues I
should be aware of?
2) Are there any potential security issues anyone can think of?
3) Can I send data via XMLHTTP in the way I have in mind?
Any light/advice/help anyone can provide on this would be appreciated.
Thanks for your time,
Colin
I am currently using a system you are probably familiar with if you have
done any templating with vbscript, define a template file with special
tokens in it(like ##Content## etc), load the file and replace these with
strings on each page. This works well but means on some pages there are vast
string concatenations to make up the content areas etc.
I had a bit of a brainwave and started rewriting my templating functions to
support 2 files, the template file and the content file. The template is
loaded via the fso, and some tokens are replaced, then I load the content
file via Msxml2.ServerXMLHTTP which allows me to execute vbscript in the
other file. I then have one page to which all page requests are sent(eg
default.asp?url=/home.asp) which loads the template and loads the requested
content file then merges both. This worked well until I started trying to
integrate it into my CMS!
The immediate problem was users login could not be read from session by the
xmlhttp loaded content page (guessing these pages are considered a different
session), but this can be got around by writing actual cookies rather than
Session vars only, or by maintaining a 'current users' table in the site
database and passing a user token back and forth.
Next prob was querystrings, but I can request these from the 'container' and
pass them down into the second page via Msxml2.ServerXMLHTTP get requests.
The big problem I have hit is forms, i can't think how to pass forms to the
second page, obviously get requests aren't a problem, but I can't change all
my forms to get since the quantity of info in some would kill the
querystring, I also have some multipart/form-data forms that i haven't a
clue how to pass.
The only inkling of an idea I have is to intercept all qstrings/posted data
at the container level into a custom collection and then to pass these to
the secondary page in some way. It's the 'some way' i'm not so sure about
I suppose my questions are:
1) Is this approach used out there? If so any performance issues I
should be aware of?
2) Are there any potential security issues anyone can think of?
3) Can I send data via XMLHTTP in the way I have in mind?
Any light/advice/help anyone can provide on this would be appreciated.
Thanks for your time,
Colin