Do per scontato che i link siano del tipo
modifica.asp
codice:
<%
submit = request.serverVariables("REQUEST_METHOD") = "POST"
questaPagina = request.serverVariables("PATH_INFO")
set conn = server.createObject("ADODB.Connection")
conn.open connString
if submit then
id = request.form("id")
titolo = request.form("titolo")
testo = request.form("testo")
conn.execute("UPDATE articoli SET titolo = '" & replace(titolo,"'","''") & "', testo = '" & replace(testo,"'","''") & "' WHERE [ID] = " & id
else
id = request.queryString("id")
if len(id) > 0 and isNumeric(id) then
sql = "SELECT * FROM articoli WHERE [ID] = " & id
set rs = conn.execute(sql)
if not rs.eof then
titolo = rs("titolo")
testo = rs("testo")
end if
rs.close
set rs = nothing
end if
end if
conn.close
set conn = nothing
if submit then response.redirect questaPagina & "?id=" & id
%>
<html>
<head>
<titolo>titolo pagina</titolo>
</head>
<body>
<form method="post" action="<%=questaPagina%>">
<label for="titolo">Titolo</label>
<input type="text" name="titolo" id="titolo" value="<%=titolo%>" />
</p>
<label for="testo">Testo</label>
<textarea name="testo" id="testo" cols="30" rows="15"><%=testo%></textarea>
</p>
<input type="hidden" name="id" value="<%=id%>" />
<input type="submit" value="esegui" />
</p>
</form>
</body>
</html>