thaiall logomy background
coding : textsearch. listsearch.asp.
my town
Source : Perl | PHP | ASP | JSP | HTML | HTML5 | JavaScript | Java | COBOL | C++ | MS Access | VBNet | VB | Python | โค้ดดี
File : listsearch.asp. ID : 2404
Skin : Default | Sons-of-obsidian | Sunburst | Highlighter | Full
<body>
<a href=listsearch.asp?opt=1>opt=1 good view</a><br>
<a href=listsearch.asp?opt=2>opt=2 array view</a><br>
<a href=listsearch.asp?opt=3>opt=3 plain text</a><hr>
<%
dim ar, opt, result, allrec, i, rp, sp
opt = request.querystring("opt")
result = "error"
set ftxt=createobject("scripting.filesystemobject")
set ln = ftxt.opentextfile(server.mappath("/cgi-bin/search.dat"))
if opt = 1 then
  response.write("<ol>")
  do while not ln.atendofstream
    ar = split(ln.readline,":",-1,1)
    response.write("<li>" & ar(0))
    response.write(" <a href=http://" & ar(1) &">")
    response.write(ar(1) &"</a> " & ar(2))  
  loop
  response.write("</ol>")
  result = "ok"
end if
if opt = 2 then
  allrec = ln.readall
  ar = split(allrec,chr(10),-1,1)
  response.write("<ol>Total record : "&ubound(ar))
  for i = 0 to ubound(ar)-1
    sp = split(ar(i),":",-1,1)
    rp = replace(ar(i),sp(1)," [<b>"&sp(1)&"</b>]<br>")
    response.write("<li>"&sp(0)&rp&sp(2))
  next
  response.write("</ol>")
  result = "ok"
end if
if opt = 3 then
  allrec = ln.readall
  response.write("<pre>")
  response.write(allrec)
  response.write("</pre>")
  result = "ok"
end if
if opt = "" then
  response.write("No option")
end if
ln.close
response.write "<hr>List : " & result
%>
</body>
จำนวน : 47 บรรทัด
าษาเฮชทีเอ็มแอล (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