Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    passaggio variabili da form a html

    Sto cercando di passare le variabili del server alla pagina che ricevo di risultato,purtroppo passano tutti i request.form solamente..
    cosa sbaglio?non passano nemmeno in plain text.. grazie per un aiuto!Ciaoo

    ----------send.asp-----------------------------
    dim redir, mailto, mailfrom, subject, item, body, cc, bcc, message, html, template, usetemplate, testmode , nomeDominio, indirizzoIp, modulo, browserSistemaOperativo, Data
    redir = request.form("redirect")
    mailto = request.form("mailto")
    cc = request.form("cc")
    bcc = request.form("bcc")
    mailfrom = request.form("mailfrom")
    subject = request.form("subject")
    message = request.form("message")
    template = request.form("template")
    testmode = lcase(request.form("testmode"))="yes"
    nomeDominio = Request.ServerVariables("HTTP_HOST")
    indirizzoIp = Request.ServerVariables("REMOTE_ADDR")
    modulo = Request.ServerVariables("HTTP_REFERER")
    browserSistemaOperativo = Request.ServerVariables("HTTP_USER_AGENT")
    Data = Now()

    ------result.htm---------------------

    etc..etc..

    <tr valign="top">
    <td><font color="#0000CC">Data invio:</font></td>
    <td colspan="2">[$Data$]</td>
    </tr>
    <tr valign="top">
    <td><font color="#0000CC">Nome dominio:</font></td>
    <td colspan="2">[$nomeDominio$]</td>
    </tr>
    <tr valign="top">
    <td><font color="#0000CC">Indirizzo IP:</font></td>
    <td colspan="2">[$indirizzoIP$]</td>
    </tr>
    <tr valign="top">
    <td><font color="#0000CC">Modulo:</font></td>
    <td colspan="2">[$modulo$]</td>
    </tr>
    <tr valign="top">
    <td><font color="#0000CC">Browser & OS:</font></td>
    <td colspan="2">[$browserSistemaOperativo$]</td>
    </tr>
    --------------------------------------------------
    Windows ha eseguito una operazione non valida e sara` terminato.
    Se il problema persiste, si consiglia di installare Linux.

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,563
    Ma in che linguaggio vorresti farlo?

    Roby

  3. #3
    questo è lo script in che stavo cercando di usare...send.asp..

    ----------------------------------------

    option explicit

    function getTextFromFile(path)
    dim fso, f, txt
    set fso = createobject("Scripting.FileSystemObject")
    if not fso.fileexists(path) then
    getTextFromFile = ""
    exit function
    end if
    set f = fso.opentextfile(path,1)
    if f.atendofstream then txt = "" else txt = f.readall
    f.close
    set f = nothing
    set fso = nothing
    getTextFromFile = txt
    end function

    dim redir, mailto, mailfrom, subject, item, body, cc, bcc, message, html, template, usetemplate, testmode , nomeDominio, indirizzoIp, modulo, browserSistemaOperativo, Data
    redir = request.form("redirect")
    mailto = request.form("mailto")
    cc = request.form("cc")
    bcc = request.form("bcc")
    mailfrom = request.form("mailfrom")
    subject = request.form("subject")
    message = request.form("message")
    template = request.form("template")
    testmode = lcase(request.form("testmode"))="yes"
    nomeDominio = Request.ServerVariables("HTTP_HOST")
    indirizzoIp = Request.ServerVariables("REMOTE_ADDR")
    modulo = Request.ServerVariables("HTTP_REFERER")
    browserSistemaOperativo = Request.ServerVariables("HTTP_USER_AGENT")
    Data = Now()

    if len(template) > 0 then template = getTextFromFile(server.mappath(template))
    if len(template) > 0 then usetemplate = true else usetemplate = false
    dim msg : set msg = server.createobject("CDONTS.NewMail")
    if usetemplate and lcase(request.form("html")) = "yes" then
    msg.bodyformat = 0 '(html)
    msg.mailformat = 0 '(mime)
    end if
    msg.subject = subject
    msg.to = mailto
    msg.from = mailfrom
    if len(cc) > 0 then msg.cc = cc
    if len(bcc) > 0 then msg.bcc = bcc

    if not usetemplate then
    body = body & message & vbcrlf & vbcrlf
    else
    body = template
    end if
    for each item in request.form
    select case item
    case "redirect", "mailto", "cc", "bcc", "subject", "message", "template", "html", "testmode"
    case else
    if not usetemplate then
    if item <> "mailfrom" then body = body & item & ": " & request.form(item) & vbcrlf & vbcrlf
    else
    body = replace(body, "[$" & item & "$]", replace(request.form(item), vbcrlf, "
    "))
    end if
    end select
    next

    if usetemplate then 'remove any leftover placeholders
    dim rx : set rx = new regexp
    rx.pattern = "\[\$.*\$\]"
    rx.global = true
    body = rx.replace(body, "")
    end if

    msg.body = body
    if testmode then
    if lcase(request.form("html")) = "yes" then
    response.write "<pre>" & vbcrlf
    response.write "Mail to: " & mailto & vbcrlf
    response.write "Mail from: " & mailfrom & vbcrlf
    if len(cc) > 0 then response.write "Cc: " & cc & vbcrlf
    if len(bcc) > 0 then response.write "Bcc: " & bcc & vbcrlf
    response.write "Subject: " & subject & vbcrlf & string(80,"-") & "</pre>"
    response.write "Data: " & Data & vbcrlf
    response.write "nomeDominio: " & nomeDominio & vbcrlf
    response.write "indirizzoIP: " & indirizzoIP & vbcrlf
    response.write "modulo: " & modulo & vbcrlf
    response.write "browserSistemaOperativo: " & browserSistemaOperativo & vbcrlf
    response.write body
    else
    response.write "<html><head><title>Sendmail.asp Test Mode</title></head><body><pre>" & vbcrlf
    response.write "Mail to: " & mailto & vbcrlf
    response.write "Mail from: " & mailfrom & vbcrlf
    if len(cc) > 0 then response.write "Cc: " & cc & vbcrlf
    if len(bcc) > 0 then response.write "Bcc: " & bcc & vbcrlf
    response.write "Subject: " & subject & vbcrlf & vbcrlf
    response.write string(80,"-") & vbcrlf & vbcrlf & "<span style=""color:blue;"">"
    response.write body & "</span>" & vbcrlf & vbcrlf
    response.write "Data: " & Data & vbcrlf & vbcrlf
    response.write "nomeDominio: " & nomeDominio & vbcrlf & vbcrlf
    response.write "indirizzoIP: " & indirizzoIP & vbcrlf & vbcrlf
    response.write "modulo: " & modulo & vbcrlf & vbcrlf
    response.write "browserSistemaOperativo: " & browserSistemaOperativo & vbcrlf & vbcrlf
    response.write string(80,"-") & vbcrlf & "**END OF EMAIL**</pre></body></html>"
    end if
    else
    msg.send
    response.redirect redir
    end if
    set msg = nothing
    %>
    Windows ha eseguito una operazione non valida e sara` terminato.
    Se il problema persiste, si consiglia di installare Linux.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.