Da uno script di invio email che finalmente sono riuscito a far funzionare dopo una fatica tremenda, mi sorge sempre lo stesso problema....
Dalla pagina di invio dati, eseguo l'invio ad una pagina di riconferma dati, e fino a qui tutto ok
<%Response.Write(request.Form ("nome"))%> ecc..ecc..
-------------------------------------------------->
tutti i response li ho messi dentro un'altro form nella pagina di conferma dati e li vorrei reinviare al database sotto forma di
<form method="POST" action="nuovo.asp">
<input type="submit"> ecc.
-------------------------------------------------
nel nuovo.asp faccio eseguire lo script che segue
-------------------------------------------------
<%@LANGUAGE = JScript%>
<%
var nome = new String(Request.Form("nome"));
var email = new String(Request.Form("email"));
var Annuncio = new String(Request.Form("Annuncio"));
var messaggio = new String(Request.Form("messaggio"));
var Rubrica = new String(Request.Form("Rubrica"));
var paese = new String(Request.Form("paese"));
var data = new Date();
var modificato = data.getDate() + "/" + (data.getMonth() + 1) + "/" + data.getYear() + " " + data.getHours() + "." + data.getMinutes() + "." + data.getSeconds();
if ((nome == "") || (nome == "undefined") || (nome.charAt(0) == " "))
{
Response.Redirect("errore.asp?id=1");
}
if ((Annuncio == "") || (Annuncio == "undefined") || (Annuncio.charAt(0) == " "))
{
Response.Redirect("errore.asp?id=2");
}
if ((messaggio == "") || (messaggio == "undefined") || (messaggio.charAt(0) == " "))
{
}
if ((Rubrica == "") || (Rubrica == "undefined") || (Rubrica.charAt(0) == " "))
{
}
if ((paese == "") || (paese == "undefined") || (paese.charAt(0) == " "))
{
Response.Redirect("errore.asp?id=3");
}
var Cn = new ActiveXObject("ADODB.Connection");
var Rs = new ActiveXObject("ADODB.Recordset");
Cn.Open("driver={Microsoft Access Driver (*.mdb)};dbq=" + Server.MapPath("Rubriche_Annunci.mdb"));
Rs.Open("messaggi",Cn,3,3);
Rs.AddNew();
Rs("nome") = nome;
Rs("email") = email;
Rs("Annuncio") = Annuncio;
Rs("messaggio") = messaggio;
Rs("Rubrica") = Rubrica;
Rs("paese") = paese;
Rs("risposte") = 0;
Rs("modificato") = modificato;
Rs.Update();
Rs.Close();
Response.Redirect("index.asp");
Cn.Close();
%>
---------------------
Nel file errore.asp uso
---------------------
<%@LANGUAGE = JScript%>
<%
var id = new String(Request.QueryString("id"));
%>
<html>
<head>
<title>Forum :: Errore</title>
<style type="text/css">
body { margin: 0px, 0px, 0px, 0px; }
div, td, input, textarea { font-size: 10px; font-family: Verdana; }
a { color: #0000FF; text-decoration: None; }
a:hover { color: #FF0000; text-decoration: Underline; }
</style>
</head>
<body>
<div align="center">
<font color="#FF0000">ERRORE</font>
<%
if (id == "1")
{
Response.Write("Inserisci il tuo nome per favore");
}
else if (id == "2")
{
Response.Write("Inserisci l' Annuncio della discussione per favore");
}
else if (id == "3")
{
Response.Write("Inserisci il messaggio per favore");
}
else
{
Response.Redirect("index.asp");
}
%>
Torna indietro
</div>
</body>
</html>
------------------------------------------------------------------------------
Al momento dell'invio l'errore è "Inserisci il tuo nome per favore" come da errore.asp
help! Qualcuno mi aiuti![]()

Rispondi quotando