|
|
|
ขอตัวอย่าง code การประมวลผลแบบสอบถามออนไลน์หน่อยค่ะ |
|
|
|
|
|
|
|
คือว่าเขียน code asp แบบสอบถาม online อ่ะค่ะ ใช้ฐานข้อมูลเป็น access โปรแรมสามรถเก็บข้อมูลดิบได้แล้วแต่ว่าไม่รู้จะให้มันประมวลผลออกมาอย่างไร ไม่รู้ว่าต้องเขียน code งัยอ่ะค่ะ
ช่วยชี้แนะหน่อยนะคะ เครียดมากเลย
-------code----------------------------------------------------------
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="./cSS/front_style.css" rel="stylesheet" type="text/css">
</head> <body leftmargin="0" topmargin="0">
x = Request.ServerVariables("REMOTE_ADDR")
'-------------------------- connect to DB " Announce" --------------------------------
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.Open Server.MapPath("db/quiz.mdb")
set rs = server.CreateObject("ADODB.recordset")
rs.open "Select * from IP_tbl where IP_Address = '"&x&"' ",conn,1,3
if not rs.eof then
%>
<script language="JavaScript">
alert("ท่านไม่สามารถบันทึกแบบสอบถามได้เนื่องจากได้กรอกไปแล้ว");
window.location = "test.html";
</script>
<%
else
set rs = server.CreateObject("ADODB.recordset")
rs.open "select * from IP_tbl",conn,2,2
rs.addnew
rs("IP_Address") =Request.ServerVariables("REMOTE_ADDR")
rs("date") = date()
rs("time") = time()
rs("1") = request.Form("SEX")
rs("2") = request.Form("AGE")
rs("3") = request.Form("EDUC")
rs("4") = request.Form("position")
rs("5") = request.Form("CAREER")
rs("6") = request.Form("news")
rs("7") = request.Form("search")
rs("8") = request.Form("app")
rs("9") = request.Form("club")
rs("10") = request.Form("hr")
rs("11") = request.Form("ejoin")
rs("12") = request.Form("buy")
rs("13") = request.Form("B_FreqTime")
rs("14") = request.Form("B_Member")
rs("15") = request.Form("B_Purpose")
rs("16") = request.Form("Freq")
rs("17") = request.Form("comment")
rs("18") = request.Form("vote")
rs("19") = request.Form("freqvote")
rs("20") = request.Form("Instru1")
rs("21") = request.Form("interest")
rs("22") = request.Form("info")
rs("23") = request.Form("word")
rs("24") = request.Form("Access")
rs("25") = request.Form("look")
rs("26") = request.Form("useful")
rs("27") = request.Form("newcontent")
rs("28") = request.Form("relation")
rs("29") = request.Form("p_relation")
rs("30") = request.Form("design")
rs("31") = request.Form("read")
rs("32") = request.Form("ME_Opinion")
rs("33") = request.Form("ME_Funny")
rs("34") = request.Form("color")
rs("35") = request.Form("picture")
rs("36") = request.Form("wordesey")
rs("37") = request.Form("kind")
rs("38") = request.Form("searchcon")
rs("39") = request.Form("useesey")
rs("40") = request.Form("speed")
rs("41") = request.Form("endcode")
rs("42") = request.Form("price")
rs("43") = request.Form("interprice")
rs("44") = request.Form("like")
rs("45") = request.Form("K_interrest")
rs("46") = request.Form("B_Using1")
rs("47") = request.Form("B_Using2")
rs("48") = request.Form("B_Using3")
rs("49") = request.Form("Incontent")
rs("50") = request.Form("B_frequentcy")
rs("51") = request.Form("detail")
rs("52") = request.Form("wantprice")
rs("53") = request.Form("problem")
rs("54") = request.Form("edit")
rs("55") = request.Form("topic")
rs.update
%>
<%end if%>[
<%
'set rs2 = server.CreateObject("ADODB.recordset")
' rs2.open "Select * from question_tbl where Vote_Choice = "&session("choices"),conn,1,3
'm = rs2("vote_volumn")
'm = m+1
' set rs3 = server.CreateObject("ADODB.recordset")
' rs3.open "Update Vote_Tbl SET Vote_Volumn = "&m&" where Vote_Choice = "&session("choices"),conn,1,3
%>
<script language="JavaScript">
str = "ท่านได้ทำการตอบแบบสอบถามเรียบร้อยแล้ว";
alert(str);
window.location = "test.html";
</script>
</body>
</html>
Tag : - - - -
|
|
|
|
|
|
Date :
28 พ.ย. 2550 10:51:33 |
By :
nazai |
View :
3741 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
asp อยู่อีกบอร์ดนึงจ้า
<<<< มองไปทางซ้ายมือ
|
|
|
|
|
Date :
28 พ.ย. 2550 11:17:41 |
By :
hobbits |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|