thaiall logomy background
coding : textsearch. find.asp.
my town
Source : Perl | PHP | ASP | JSP | HTML | HTML5 | JavaScript | Java | COBOL | C++ | MS Access | VBNet | VB | Python | โค้ดดี
File : find.asp. ID : 2405
Skin : Default | Sons-of-obsidian | Sunburst | Highlighter | Full
<body><form action=find.asp method=post>
<input name=getkey>
<select name=gettype>
<option value=basic selected>Basic
<option value=advance>Advance
</select><input type=submit value=find>
</form><hr>
<%
dim ar, getkey, gettype, allrec
getkey = request.form("getkey")
gettype = request.form("gettype")
set ftxt=createobject("scripting.filesystemobject")
set ln = ftxt.opentextfile(server.mappath("/cgi-bin/search.dat"))
if gettype = "basic" then
  response.write("<ol>")
  do while not ln.atendofstream
    recline = ln.readline
    ar = split(recline,":",-1,1)
    if instr(lcase(recline),lcase(getkey)) > 0 then 
      response.write("<li>" & ar(0))
      response.write(" <a href=http://" & ar(1) &">")
      response.write(ar(1) &"</a> " & ar(2))  
    end if
  loop
  response.write("</ol>")
end if
if gettype = "advance" then
  allrec = ln.readall
  set re = new regexp
  re.ignorecase = true
  re.global = true
  re.pattern = getkey
  set matches = re.execute(allrec)
  response.write("Find for [ "& getkey &" ]<br>")
  for each match in matches
    response.write("Position : "& match.firstindex & " - ")  
    response.write(match.value & "<br>")  
  next
  if matches.count > 0 then
    response.write("Found : " & matches.count)
  else 
    response.write "<hr>Find : Not found"
  end if
end if  
ln.close
%></body>
จำนวน : 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