codice:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
dim msg
msg=request.QueryString("msg")
%>
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' *** Redirect if username exists
MM_flag = "MM_insert"
If (CStr(Request(MM_flag)) <> "") Then
Dim MM_rsKey
Dim MM_rsKey_cmd
MM_dupKeyRedirect = "Musica-inserimento.asp?msg=Titolo gia' presente, se necessario inserire trattini o punti per renderlo diverso"
MM_dupKeyUsernameValue = CStr(Request.Form("titolo"))
Set MM_rsKey_cmd = Server.CreateObject ("ADODB.Command")
MM_rsKey_cmd.ActiveConnection = MM_musica_STRING
MM_rsKey_cmd.CommandText = "SELECT titolo FROM Canzoni WHERE titolo = ?"
MM_rsKey_cmd.Prepared = true
MM_rsKey_cmd.Parameters.Append MM_rsKey_cmd.CreateParameter("param1", 200, 1, 255, MM_dupKeyUsernameValue) ' adVarChar
Set MM_rsKey = MM_rsKey_cmd.Execute
If Not MM_rsKey.EOF Or Not MM_rsKey.BOF Then
' the username was found - can not add the requested username
MM_qsChar = "?"
If (InStr(1, MM_dupKeyRedirect, "?") >= 1) Then MM_qsChar = "&"
MM_dupKeyRedirect = MM_dupKeyRedirect & MM_qsChar & "requsername=" & MM_dupKeyUsernameValue
Response.Redirect(MM_dupKeyRedirect)
End If
MM_rsKey.Close
End If
%>
<%
If (CStr(Request("MM_insert")) = "form1") Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_musica_STRING
MM_editCmd.CommandText = "INSERT INTO Canzoni ([titolo], testosong, mptre, lettera) VALUES (?, ?, ?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 255, Request.Form("titolo")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 203, 1, 1073741823, Request.Form("testosong")) ' adLongVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 203, 1, 1073741823, Request.Form("mptre")) ' adLongVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 255, Request.Form("lettera")) ' adVarWChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "/pc.asp?messaggio=Canzone inserita. Grazie"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Inserimento Musica</title>
<script language="JavaScript" type="text/javascript" src="/admin/rtfedit/wysiwyg.js"></script>
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
}
.Stile2 {font-family: Arial, Helvetica, sans-serif}
.style1 {font-family: "Times New Roman", Times, serif}
-->
</style></head>
<body>
<span class="Stile2">Home<span class="style1">==</span>>Pannello di controllo</span></p>
Inserimento Canzone - Modifica o Eliminazione Canzone</p>
</p>
<div align="center">
<%if msg <> "" then%>
<table width="550" border="0" cellpadding="0" cellspacing="0" bgcolor="#FF6600">
<tr>
<td><div align="center">
<%
response.Write(msg)
%>
</div></td>
</tr>
</table>
<%
end if
%>
</div><form action="<%=MM_editAction%>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Titolo:</td>
<td><span id="titoloSPRAY">
<label>
<input name="titolo" type="text" id="titolo" size="80" />
</label>
<span class="textfieldRequiredMsg">Devi inserire un titolo.</span></span></td>
</tr>
<tr>
<td nowrap="nowrap" align="right" valign="top">Testo:</td>
<td valign="baseline"><textarea name="testosong" cols="80" id="testosong"></textarea>
<script language="JavaScript">generate_wysiwyg('testosong');</script> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Mp3:</td>
<td><textarea name="mptre" cols="80" id="mptre"></textarea> </td>
</tr>
<tr>
<td nowrap="nowrap" align="right" valign="top">Note:</td>
<td valign="baseline"><select name="lettera" id="lettera">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D" selected="selected">D</option>
<option value="E">E</option>
<option value="F">F</option>
<option value="G">G</option>
<option value="H">H</option>
<option value="I">I</option>
<option value="J">J</option>
<option value="K">K</option>
<option value="L">L</option>
<option value="M">M</option>
<option value="N">N</option>
<option value="O">O</option>
<option value="P">P</option>
<option value="Q">Q</option>
<option value="R">R</option>
<option value="S">S</option>
<option value="T">T</option>
<option value="U">U</option>
<option value="V">V</option>
<option value="W">W</option>
<option value="X">X</option>
<option value="Y">Y</option>
<option value="Z">Z</option>
<option value="Altro">altro</option>
</select></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"></td>
<td><input type="submit" value="Inserisci" /> </td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
</p>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("titoloSPRAY", "none", {validateOn:["blur", "change"]});
//-->
</script>
</body>
</html>
<script type="text/javascript" language="JavaScript" src="http://www.cattedralepescia.it/statistiche/stats_js.asp"> </script>