CIAO! c'è qualcuno gentile che mi sappia indicare se c'è qualcosa di sbagliato in qst codice ASP, che fa riferimento ad un form
in html? Premetto che il form non funziona (cioè non funziona il pulsante INVIA in esso contenuto che dovrebbe linkare all'e-mail; quando clicco sul pulsante INVIA mi esce una finestra che mi chiede di effettuare il download del file post_ADV.asp)
non so se eè chiaro il problema
grazie
<%
Const adCmdFile = 256
Const adOpenKeyset = 1
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adLockBatchOptimistic = 4
const adUseClient = 3
Const adPersistXML = 1
x_data = now()
x_ragione_sociale= trim(request.Form("ragione_sociale"))
If x_cognome & "x" = "x" Then x_cognome = Null
x_indirizzo = trim(request.Form("indirizzo"))
If x_indirizzo & "x" = "x" Then x_indirizzo = Null
x_cap = trim(request.Form("cap"))
If x_cap & "x" = "x" Then x_cap = Null
x_citta = trim(request.Form("citta"))
If x_citta & "x" = "x" Then x_citta = Null
x_provincia = trim(request.Form("provincia"))
If x_provincia & "x" = "x" Then x_provincia = Null
x_telefono = trim(request.Form("telefono"))
If x_telefono & "x" = "x" Then x_telefono = Null
x_fax = trim(request.Form("fax"))
If x_fax & "x" = "x" Then x_fax = Null
x_mail = trim(request.Form("mail"))
If x_mail & "x" = "x" Then x_mail = Null
x_persona_ref = trim(request.Form("persona_ref"))
If x_persona_ref & "x" = "x" Then x_persona_ref = Null
'Cataloghi richiesti
For a = 1 to Request.Form("cataloghi_richiesti").Count
x_cataloghi_richiesti = x_cataloghi_richiesti & Request.Form("cataloghi_richiesti")(a) & ", "
Next
x_cataloghi_richiesti = left(x_cataloghi_richiesti,len(x_cataloghi_richies ti)-2)
x_qta = trim(request.Form("qta"))
If x_qta & "x" = "x" Then x_qta = 0
x_commenti = left(trim(request.Form("commenti")),250)
If x_commenti & "x" = "x" Then x_commenti = Null
x_trattamentodati = trim(request.Form("trattamentodati"))
If x_trattamentodati & "x" = "x" Then x_trattamentodati = 0
' Delete existing file
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
x_fileDataXmlSchema = server.mappath("Dataschema.xml")
If not objFSO.FileExists(x_fileDataXml) Then
objFSO.CopyFile x_fileDataXmlSchema, x_fileDataXml
End IF
on error resume next
set rs = server.createobject("ADODB.Recordset")
rs.CursorLocation = adUseClient
rs.open x_fileDataXml, ,adOpenKeyset,adLockBatchOptimistic , adCmdFile
rs.addnew
rs("data") = x_data
rs("ragione_sociale") = x_ragione_sociale
rs("indirizzo") = x_indirizzo
rs("cap") = x_cap
rs("citta") = x_citta
rs("provincia") = x_provincia
rs("telefono") = x_telefono
rs("fax") = x_fax
rs("mail") = x_mail
rs("persona_ref") = x_persona_ref
rs("cataloghi_richiesti") = x_cataloghi_richiesti
rs("qta") = x_qta
rs("commenti") = x_commenti
rs("trattamentodati") = x_trattamentodati
rs.update
If objFSO.FileExists(x_fileDataXml) Then
objFSO.DeleteFile x_fileDataXml
End IF
Set objFSO = Nothing
rs.Save x_fileDataXml, adPersistXML
rs.close
set rs = nothing
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>MLA - vacanze studio e turismo</title>
</head>
<body style="font-family: Verdana; font-size: 12pt">
<%
if err = 0 then
response.redirect "Registrazione_OK.htm"
'response.write "
Invio dati: operazione ultimata ed eseguita correttamente!"
'response.Write "
agenzia: " & x_ragione_sociale & " " & x_cognome
'response.write "
La vostra richiesta sarà evasa prima possibile."
'response.Write "
Grazie."
else
response.write "
Invio dati: Si sono verificati dei problemi, riprovare più tardi."
response.write "
Torna Indietro"
end if
%>
</body>
</html>

Rispondi quotando