1 / 8

การพัฒนาโปรแกรมประยุกต์บนเว็บ

การพัฒนาโปรแกรมประยุกต์บนเว็บ. Get, Post, Session, Cookies. มหาวิทยาลัยโยนก จังหวัดลำปาง ศูนย์กลางความรู้และภูมิปัญญาแผ่นดิน http://www.yonok.ac.th. อ.บุรินทร์ รุจจนพันธุ์ . ปรับปรุง 28 มิถุนายน 2550. HTML of GET & POST. http://localhost/x.htm <form action=y.asp method= post >

parishn
Download Presentation

การพัฒนาโปรแกรมประยุกต์บนเว็บ

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. การพัฒนาโปรแกรมประยุกต์บนเว็บการพัฒนาโปรแกรมประยุกต์บนเว็บ Get, Post, Session, Cookies มหาวิทยาลัยโยนก จังหวัดลำปาง ศูนย์กลางความรู้และภูมิปัญญาแผ่นดิน http://www.yonok.ac.th อ.บุรินทร์ รุจจนพันธุ์ . ปรับปรุง 28 มิถุนายน 2550

  2. HTML of GET & POST http://localhost/x.htm <form action=y.asp method=post> <input name=a><input type=submit></form> <form action=y.asp method=get> <input name=a><input type=submit></form>

  3. แสดงค่าที่รับเข้ามาจาก GET และ POST <% ‘ y.asp a = "" if(len(request.form("a")) > 0)then response.write(request.form("a")) end if if(len(request.querystring("a")) > 0)then a = request.querystring("a") response.write(a) end if %>

  4. แสดงค่าใน servervariables <? for each Item in request.servervariables response.write Item & " = " a = request.servervariables(Item) response.write (a & "<br>”) next ?>

  5. global.asa ถ้าเก็บแฟ้ม global.asa ในห้องที่เก็บแฟ้ม .asp ผลคือ เมื่อเปิดแฟ้มที่สกุล .asp ใดก็ตาม IIS จะช่วย แทรกภาพมุมบนซ้าย ในเว็บเพจนั้น สามารถนำไปใช้เพิ่ม counter ให้ทุกหน้าโดยอัตโนมัติ <script language=vbscript runat=server> sub Session_OnStart response.write"<div style='position:absolute;left:0px;top:0px;z-index:0;'>" response.write"<img src=http://www.thaiall.com/me/picme.jpg></div>" Session.Abandon end sub </script>

  6. กำหนด และใช้งาน เซสชัน (Session) <!--#include file="wisdom.asp"--> <? session("a") = request.form("a") response.write(session(“a”)) dim i For Each i in Session.StaticObjects Response.Write(i & "<br />") Next response.end ?> ข้อมูลจาก http://www.w3schools.com/asp/asp_sessions.asp

  7. กำหนดค่าให้กับ คุกกี้ (Cookies) <? intPollID=19 Response.Cookies("PollId")=intPollID Response.Cookies("PollId").Expires=Now+60 ?> ข้อมูลจาก http://www.codefixer.com/tutorials/cookies.asp

  8. นำ คุกกี้ (Cookies) มาใช้ <% PollID = 19 voteid= Request.Cookies("PollID") If Cint(voteid) = Cint(PollID) Then response.write "already vote" Else ’ show poll End If %> ข้อมูลจาก http://www.codefixer.com/tutorials/cookies.asp

More Related