Home > Archive > ASP > January 2006 > is it possible to get a page and put it in a variable?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
is it possible to get a page and put it in a variable?
|
|
| diablo 2006-01-26, 3:55 am |
| Xref: TK2MSFTNGP08.phx.gbl microsoft.public.inetserver.asp.general:301663
Hi
basically i want to send a web page off by email. so i was thinking of
putting some asp scrip at the end of the page to do this...
<html>.....</html>
<%
dim a
a = page_content
send_email(page_content)
%>
but how do i get page content? Is there some variable I can read that has it
stored? is there some way I can all the stuff that has gone out to browser?
Cheers for any help
Kal
| |
| Steven Burn 2006-01-26, 7:55 am |
| Stick it into a variable *BEFORE* writing it to the browser .... you can
then re-use the variable.
Note however, unless it's a fairly small page, storing it in a var is NOT a
good idea.
'//***********************
'// example.asp
'//***********************
Option Explicit
Dim sMyString
sMyString = "<html><head><title>" & _
"Something</title></head><body>" & _
"Some random text</body></html>"
Response.Write sMyString
Send_email(sMyString)
'// END
As an aside, you might want to re-think your naming conventions. Else in
time to come, you'll have to drive yourself silly remembering what "a"
actually is meant to be (i.e. string, long, integer, variant etc) (ASP
doesn't give a rats as their all variants as far as it's concerned, but it's
nice to remind yourself regardless).
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
"diablo" <diablo@noplace.com> wrote in message
news:OO%Bf.12819$mf2.10920@newsfe6-win.ntli.net...
> Hi
>
> basically i want to send a web page off by email. so i was thinking of
> putting some asp scrip at the end of the page to do this...
>
> <html>.....</html>
>
> <%
> dim a
> a = page_content
> send_email(page_content)
> %>
>
> but how do i get page content? Is there some variable I can read that has
it
> stored? is there some way I can all the stuff that has gone out to
browser?
>
> Cheers for any help
>
> Kal
>
>
>
>
| |
| Larry Bud 2006-01-26, 6:55 pm |
|
diablo wrote:
> Hi
>
> basically i want to send a web page off by email. so i was thinking of
> putting some asp scrip at the end of the page to do this...
>
> <html>.....</html>
>
> <%
> dim a
> a = page_content
> send_email(page_content)
> %>
>
> but how do i get page content? Is there some variable I can read that has it
> stored? is there some way I can all the stuff that has gone out to browser?
>
> Cheers for any help
The position in the browser of your code is irrelevant. The only way
to get the "stuff" is to retrieve a URL, such as
Set objSrvHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0")
objSrvHTTP.setTimeouts 1500,1500,1500,1500
objSrvHttp.open "GET", "http://www.google.com", false
objSrvHttp.send
rt=objSrvHttp.responseText
set objSrvHttp=nothing
| |
|
|
|
|
|