======================ส่วนข้อมูลที่รับมาจาก
forms============================
<%
name=Request.Form("name")
email=Request.Form("email")
comment=replace(replace(replace(Request.Form("comment"),"<","<"),">",">"),chr(13),"<br>")
======================ส่านติดต้อฐานข้อมูล====================================
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "DRIVER={Microsoft Access Driver (*.MDB)};DBQ="
& Server.Mappath("ohlanladb.mdb")
sql = "SELECT * FROM [ohlanla]"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
=====================ส่วนที่จะเก็บลงในฐานข้อมูล=======================
rs.Addnew
rs("name")=name
rs("email")=email
rs("comment")=comment
rs.Update
rs.close
conn.Close
%>
=====================โค๊ช htm=============================
<html>
<head>
<title>ok</title>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-874">
</head>
<body>
ok เพิ่มเรียบร้อย
</body>
</html>
|