thaiall logomy background
coding : updatemdb. edittmpnum.asp.
my town
Source : Perl | PHP | ASP | JSP | HTML | HTML5 | JavaScript | Java | COBOL | C++ | MS Access | VBNet | VB | Python | โค้ดดี
File : edittmpnum.asp. ID : 2508
Skin : Default | Sons-of-obsidian | Sunburst | Highlighter | Full
<%
' ถ้ากำหนด dim connect,sql จะ error : Name redefined 
' เพราะเรียกโปรแกรมภายนอก selecttab.asp แต่โปรแกรมนั้นกำหนด dim ไว้แล้ว
' dim connect, sql 
dim gtmpch, gtmpnum, toconfirm, found
found = 0
gtmpnum = request.form("gtmpnum")
gtmpch = request.form("gtmpch")
toconfirm = request.form("toconfirm")
set connect = server.createobject("ADODB.Connection")
connect.open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &_
Server.MapPath("\perlphpasp\db\tempdb.mdb"))
if toconfirm = "yes" then
  sql="update tempfile set tmpnum = "& gtmpnum 
  sql=sql & " where tmpch ='" & gtmpch & "'"
  connect.execute(sql)   	  
  connect.close
  set connect = nothing
  response.write("Edit : ok")
else
  sql = "select * from tempfile"
  set rs = connect.execute(sql)
  do while not rs.eof    
    if trim(rs("tmpch")) = gtmpch then   ' trim จะลบช่องว่างทั้งซ้ายและขวา
      found = 1
    end if
    rs.movenext
  loop
  connect.close
  set rs = nothing
  set connect = nothing
  if found = 1 and len(gtmpnum) > 0 then
    response.write("<form action=edittmpnum.asp method=post>")
    response.write("<input type=hidden name=gtmpnum value=" & gtmpnum & ">")
    response.write("<input type=hidden name=gtmpch value='" & gtmpch & "'>")
    response.write("<br>Your request : " & gtmpch & " - " & gtmpnum & "<br>")
    response.write("<input type=hidden name=toconfirm value=yes>")
    response.write("<input type=submit value=Confirm>")
    response.write("</form>")
  else
    response.write("Not found or tmpnum equal 0")
  end if
end if
%><br>
<! ด้านล่างทำงานแบบ ssi (Server Side Includes) แต่บรรทัดนี้เป็น comment ใน html>
<!--#include file=selecttab.asp-->
จำนวน : 46 บรรทัด
าษาเฮชทีเอ็มแอล (HTML = HyperText Markup Language) คือ ภาษาคอมพิวเตอร์ที่ออกแบบมาเพื่อใช้ในการสร้างเว็บเพจที่เรียกดูผ่านทางเว็บเบราว์เซอร์ (Web Browser) เริ่มพัฒนาโดย ทิม เบอร์เนอรส์ ลี (Tim Berners Lee) ในปัจจุบัน HTML ล่าสุดคือ รุ่น 5 เป็นมาตรฐานหนึ่งของ ISO ซึ่งจัดการโดย World Wide Web Consortium (W3C) ในปัจจุบัน ทาง W3C ผลักดัน รูปแบบของ HTML แบบใหม่ ที่เรียกว่า XHTML รุ่นแรกคือ 1.0 (ม.ค.2543) ซึ่งมีโครงสร้างเป็นแบบ XML (eXtensible Markup Language)
าษาพีเอชพี (PHP Language) คือ ภาษาคอมพิวเตอร์ประเภทโอเพนท์ซอร์ท (Open Source Computer Language) สำหรับพัฒนาเว็บเพจแบบไดนามิก เมื่อเครื่องบริการได้รับคำร้องจากผู้ใช้ก็จะส่งให้กับ ตัวแปลภาษา ทำหน้าที่ประมวลผลและส่งข้อมูลกลับไปยังเครื่องของผู้ใช้ที่ร้องขอ ในรูปเอชทีเอ็มแอล ภาพ หรือแฟ้มดิจิทอลอื่นใด ลักษณะของภาษามีรากฐานคำสั่งมาจากภาษาซี เป็นภาษาที่สามารถพัฒนาให้ใช้งานแบบโต้ตอบกับผู้ใช้ได้
ตัวอย่าง Hello World
ปรับปรุงโปรแกรม source.pl : 2565-07-24
rspsocial
Thaiall.com