Ohye allora ti architetto il code ok?(questo è il pannello inserisci evento)
<% if Session("Riferimento2") = "ad_admin.asp" then %>
<% Response.Expires = -1 %>
<%
bytecount = UpLoad()
if bytecount > 0 then
DataEvento = inputs("DataEvento")
Evento = inputs("Evento")
Evento = Replace (Evento, VbCrLf, "
")
set con=createobject("adodb.connection")
con.open "provider=microsoft.jet.oledb.4.0;data source="& server.mappath("database/dblibreria.mdb")
set rs=createobject("adodb.recordset")
rs.open "EVENTI",con,3,3
rs.addnew
rs("DataEvento")=DataEvento
rs("Evento")=Evento
rs.update
rs.close
set rs=nothing
con.close
set con=nothing
%>
<SCRIPT LANGUAGE=vbscript >
puls=MsgBox("Evento inserito correttamente! Vuoi inserirne un altro.",vbYesNo+vbQuestion)
if puls=vbYes then
window.location.href = "ad_ins_evento.asp"
else
window.location.href = "ad_admin.asp"
end if
</SCRIPT>
<%
else%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Inserimento Evento</title>
<script language="VBScript">
function InsEvento_onsubmit
if len(document.InsEvento.DataEvento.value) < 10 then
alert "INSERIRE DATA EVENTO!"
InsEvento_onsubmit=false
ElseIf not isdate(document.InsEvento.DataEvento.value) then
alert "LA DATA NON E' IN FORMATO CORRETTO!"
InsEvento_onsubmit=false
ElseIf len(document.InsEvento.Evento.value) < 4 then
alert "INSERIRE LA DESCRIZIONE DELL'EVENTO!"
InsEvento_onsubmit=false
else
InsEvento_onsubmit=true
end if
end function
</script>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data" name="InsEvento">
<table width="650" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="500" height="40" bgcolor="#CCCCCC" align="center"> <div align="left">
<input type="Submit" value="Inserisci">
<input type="Reset" value="Annulla">
<input type="Button" value="Admin" onclick="vbscript:window.location.href='ad_admin.a sp'">
</div></td>
</tr>
<tr>
<td width="500" height="40" bgcolor="#CCCCCC" style="font-family:verdana;font-size:10;color:#4d4d4d;font-weight=bold">
<font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Data Evento (gg/mm/aaaa)</font>
<input type="Text" name="DataEvento">
</td>
</tr>
<tr>
<td width="500" height="40" bgcolor="#CCCCCC" style="font-family:verdana;font-size:10;color:#4d4d4d;font-weight=bold">
<font color="#FFFFFF" face="Arial, Helvetica, sans-serif">Testo (max 255 caratteri)</font>
<textarea name="Evento" rows="10" cols="30"></textarea>
</td>
</tr>
<tr>
<td width="500" height="30" bgcolor="#ff9900" style="font-family:verdana;font-size:10;color:#4d4d4d;font-weight=bold"></td>
</tr>
</table>
<table width="650" border="0" align="center">
<tr>
<td>[img]immagini/navgiu.gif[/img]
<map name="Map">
<area shape="rect" coords="435,6,473,17" href="contatti.html">
<area shape="rect" coords="346,5,425,17" href="iniziative.html">
<area shape="rect" coords="253,6,332,17" href="acquista.html">
<area shape="rect" coords="38,5,120,17" href="perche.html">
<area shape="rect" coords="126,6,158,17" href="libreria.html">
<area shape="rect" coords="169,6,203,17" href="servizi.html">
<area shape="rect" coords="209,4,242,20" href="eventi.asp">
<area shape="rect" coords="483,7,506,17" href="link.html">
<area shape="rect" coords="518,7,579,18" href="ad_admin.html">
<area shape="rect" coords="2,5,30,21" href="default.asp">
</map></td>
</tr>
</table>
</form>
</body>
</html>
<%
end if
'si riferisce a if Session("Riferimento2") = "admin.asp"
else
response.redirect "default.asp"
end if%>

Rispondi quotando