QueryString Ä÷º¼Ç (Get ¹æ½Ä)
»ç¿ëÀڷκÎÅÍ Á¤º¸¸¦ ¹Þ´Â html ¹®¼¿Í ÀԷ¹ÞÀº Á¤º¸¸¦ ó¸®ÇØ ÁÖ´Â
asp ÆÄÀÏÀÌ ÇÊ¿äÇÏ´Ù.
¿¹Á¦)
html¹®¼ (Request_form.htm)
<html>
<body>
<p> </p>
<center><h3>Request°³Ã¼[QueryStringÄ÷º¼Ç(GET)]</h3>
<p> </p>
<form Method="Get"
action="Request_result.asp">
<p
style="font-size:9pt;">
À̸§ÀÔ·Â
: <input type="text" name="username" size="20">
<p
style="font-size:9pt;">
³ªÀÌÀÔ·Â
: <input type="text" name="age" size="20">
<p
style="font-size:9pt;">
ÀüȹøÈ£
: <input type="text" name="tel" size="20"><p>
<input
type="submit" value=" Àü¼Û " style="font-size:9pt; background-color:white;">
<input
type="Reset" value=" ÀçÀÛ¼º " style="font-size:9pt;
background-color:white;"></form>
</body>
</html>
ASP¹®¼ (Request_result.asp)
<html>
<body>
<p> </p>
<center><h3>Request°³Ã¼[QueryStringÄ÷º¼Ç(GET)]
Request·Î ¹ÞÀº °ª</h3>
<p> </p>
<p
style="font-size:9pt;">
À̸§Àº
<%=Request.QueryString("username")%>ÀÔ´Ï´Ù.<p>
<p
style="font-size:9pt;">
³ªÀÌ´Â
<%=Request.QueryString("age")%>ÀÔ´Ï´Ù.<p>
<p
style="font-size:9pt;">
ÀüȹøÈ£´Â
<%=Request.QueryString("tel")%>ÀÔ´Ï´Ù.<p>
</center>
</body>
</html>
#ÀÔ·ÂÀ» ÇÏ°í Àü¼ÛÀ» ÇÑ ÈÄ °á°ú°¡ ³ªÅ¸³ª´Â ºê¶ó¿ìÀúÀÇ urlÀÔ·ÂâÀ» À¯½ÉÈ÷ »ìÆ캸ÀÚ
Form Ä÷º¼Ç
(POST ¹æ½Ä)
»ç¿ëÀڷκÎÅÍ Á¤º¸¸¦ ¹Þ´Â html ¹®¼¿Í ÀԷ¹ÞÀº Á¤º¸¸¦ ó¸®ÇØ ÁÖ´Â
asp ÆÄÀÏÀÌ ÇÊ¿äÇÏ´Ù.
¿¹Á¦)
html¹®¼ (Request_form_post.htm)
<html>
<body>
<p> </p>
<center><h3>Request°³Ã¼[FormÄ÷º¼Ç(POST)]</h3>
<p> </p>
<form Method="post"
action="Request_result_post.asp">
<p
style="font-size:9pt;">
À̸§ÀÔ·Â
: <input type="text" name="username" size="20">
<p
style="font-size:9pt;">
³ªÀÌÀÔ·Â
: <input type="text" name="age" size="20">
<p
style="font-size:9pt;">
ÀüȹøÈ£
: <input type="text" name="tel" size="20"><p>
<input
type="submit" value=" Àü¼Û " style="font-size:9pt; background-color:white;">
<input
type="Reset" value=" ÀçÀÛ¼º " style="font-size:9pt;
background-color:white;"></form>
</center>
</body>
</html>
ASP¹®¼ (Request_result_post.asp)
<html>
<body>
<p> </p>
<center><h3>Request°³Ã¼[FormÄ÷º¼Ç(POST)]
Request·Î ¹ÞÀº °ª</h3>
<p> </p>
<p
style="font-size:9pt;">
À̸¥Àº
<%=Request.form("username")%>ÀÔ´Ï´Ù.<p>
<p
style="font-size:9pt;">
³ªÀÌ´Â
<%=Request.form("age")%>ÀÔ´Ï´Ù.<p>
<p
style="font-size:9pt;">
ÀüȹøÈ£´Â
<%=Request.form("tel")%>ÀÔ´Ï´Ù.<p>
</center>
</body>
</html>
#ÀÔ·ÂÀ» ÇÏ°í Àü¼ÛÀ» ÇÑ ÈÄ °á°ú°¡ ³ªÅ¸³ª´Â ºê¶ó¿ìÀúÀÇ urlÀÔ·ÂâÀ» À¯½ÉÈ÷ »ìÆ캸ÀÚ
µÎ ¿¹Á¦¿¡¼ º¸¸é
Method=POST ÀÏ ¶§¿Í GET ÀÏ ¶§ÀÇ Â÷À̸¦ ¾Ë ¼ö ÀÖ´Ù. ÇÏÁö¸¸ Áß¿äÇÑ°Ç ¹æ½Ä¿¡ µû¶ó Request.Form¿¡¼ °ªÀ» ã¾Æ ¿Ã°ÇÁö
Request.QueryString¿¡¼ ã¾Æ ¿Ã°ÇÁö ÁÖÀÇÇØ¾ß ÇÑ´Ù. Âü°í·Î Request("º¯¼ö") ÇüÅ·εµ °ªÀ» ã¾Æ ¿Ã ¼ö ÀÖ´Ù. ÀÌ·² °æ¿ì
¼øÂ÷ÀûÀ¸·Î °ªµéÀ» ã°Ô µÈ´Ù.
ServerVariables Ä÷º¼Ç
Servervariable´Â ¼¹öÀÚüÀÇ CGI¹öÀüÀ̳ª PORT, ·Î±×ÀÎ À¯Àú¸í, IPÁÖ¼ÒµîÀ» ¾Ë·ÁÁÖ´Â Ä÷º¼ÇÀÌ´Ù.
»ç¿ëÀÚÀÇ Á¢¼Ó IP ÁÖ¼Ò¸¦ ¾Ë¾Æ¿À´Â Request.Servervariables("REMOTE_ADDR") ±×¸®°í, »ç¿ëÀÚÀÇ ºê¶ó¿ìÀú³ª OS
¹öÀüÀ» ¾Ë ¼ö ÀÖ°Ô ÇØÁÖ´Â Request.Servervariables("HTTP_AGENT")µîÀÌ »ç¿ëµÈ´Ù.
¿¹Á¦1)
<html>
<body>
<P> </P>
<center><h3>ÇöÀç
»ç¿ëÀÚ´ÔÀº</h3>
<p
style="font-size:9pt;">
»ç¿ëÇϽôÂ
IP´Â <%=Request.ServerVariables("REMOTE_HOST")%>ÀÔ´Ï´Ù.<br>
ºê¶ó¿ìÀú¿Í
OS´Â<%=Request.ServerVariables("HTTP_USER_AGENT")%>ÀÔ´Ï´Ù.<p>
</center>
</body>
</html>
¿¹Á¦2)
<html>
<body>
<center><h3>ServerVariable
All</h3></center>
<table
border="1" style="font-size:7pt;" cellpadding="0" cellspacing="0"
bordercolordark="white" bordercolorlight="black">
<tr>
<td><center>Key</center></td>
<td><center>Value</center></td>
</tr>
<%
For Each key in Request.ServerVariables %>
<tr>
<td><center><%=key%></center></td>
<td>
<%
if
Request.ServerVariables(key)=""then
Response.Write" "
else
Response.Write
Request.ServerVariables(key)
end
if
%>
</td>
</tr>
<%Next%>
</table>
</body>
</html> |