<% inputnum = request.querystring("inputnum")
If IsEmpty(inputnum) or inputnum = "" then %>
<% else
data = request.form("date1")
If data = "" Then data = date()
dia = DatePart("d", data)
If dia < 10 Then dia = "0"&dia
mes = DatePart("m", data)
If mes < 10 Then mes = "0"&mes
ano = DatePart("yyyy", data)
data = dia & "/" & mes & "/" & ano
titulo = request.form("name1")
titulo = Replace(request.form("name1"), "'", "''")
titulo = Replace(Request.Form("name1"), Chr(13), "
")
autor1 = request.form("autor1")
autor1 = Replace(request.form("autor1"), "'", "''")
autor1 = Replace(Request.Form("autor1"), Chr(13), "
")
email1 = request.form("email1")
email1 = Replace(request.form("email1"), "'", "''")
email1 = Replace(Request.Form("email1"), Chr(13), "
")
entry1 = request.form("Entry1")
entry1 = Replace(Request.Form("Entry1"), "'", "''")
entry1 = Replace(Request.Form("Entry1"), Chr(13), "
")
Set Conn = Server.CreateObject("adodb.connection")
conn.Open Dados
SQLstmt = "INSERT INTO noticias (titulo,data,autor,email,materia)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & titulo & "',"
SQLstmt = SQLstmt & "'" & data & "',"
SQLstmt = SQLstmt & "'" & autor1 & "',"
SQLstmt = SQLstmt & "'" & email1 & "',"
SQLstmt = SQLstmt & "'" & entry1 & "'"
SQLstmt = SQLstmt & ")"
Set RS = conn.execute(SQLstmt)
response.redirect "submit2.asp?id=1"
end if %>