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

Discussion in 'ASP General' started by diablo, Jan 26, 2006.

  1. diablo

    diablo Guest

    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
     
    diablo, Jan 26, 2006
    #1
    1. Advertising

  2. diablo

    Steven Burn Guest

    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" <> wrote in message
    news:OO%Bf.12819$...
    > 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, Jan 26, 2006
    #2
    1. Advertising

  3. diablo

    Larry Bud Guest

    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
     
    Larry Bud, Jan 26, 2006
    #3
  4. diablo

    Guest

    , Jan 29, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven
    Replies:
    2
    Views:
    4,202
    Steven
    Mar 30, 2005
  2. Markus
    Replies:
    1
    Views:
    497
    Markus
    Nov 22, 2005
  3. Eric
    Replies:
    0
    Views:
    571
  4. Gabriel Rossetti
    Replies:
    3
    Views:
    585
    Jerry Hill
    Apr 25, 2008
  5. laredotornado
    Replies:
    3
    Views:
    463
    Dr J R Stockton
    Jun 1, 2011
Loading...

Share This Page