is it possible to get a page and put it in a variable?

D

diablo

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
 
S

Steven Burn

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!
 
L

Larry Bud

diablo said:
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
 

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

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top