$ REQUEST - GET¹æ½Ä,POST¹æ½Ä ±¸ºÐÇÏÁö ¾Ê°í °ª ¹Þ±â |
|
|
![](icon/private_name/1.gif) |
9³â Àü
|
$_REQUEST º¯¼ö
-> »ç¿ëÀÚ°¡ GET¹æ½ÄÀ̵ç POST¹æ½ÄÀ̵çÁö »ó°ü¾øÀÌ º¯¼öÀÇ µ¥ÀÌÅ͸¦ °ªÀ¸·Î ¹Þ´Â´Ù.
[¿¹Á¦]
---------------------------------------------------------------------------------------
test1.html
<form name=userinfo method=GET action="test2.html" >
¾ÆÀ̵ð <input name=userid type=text size=19>
<input type=submit value="Ŭ¸¯">
</form>
test11.html
<form name=passwd method=POST action="test2.html">
ºñ¹Ð¹øÈ£<input name=pass type=password size=19>
<input type=submit value="Ŭ¸¯">
</form>
test2.html
<?php
echo "°á°úȸé";
$var1 = $_GET["userid"];
$var2 = $_POST[pass];
echo "<br>¾ÆÀ̵ð : $var1";
echo "<br>ºñ¹Ð¹øÈ£ : $var2 ";
?>
test3.html
<?php
echo "°á°úȸé";
$var1 = $_REQUEST["userid"];
$var2 = $_REQUEST[pass];
echo "<br>¾ÆÀ̵ð : $var1";
echo "<br>ºñ¹Ð¹øÈ£ : $var2 ";
?>
-----------------------------------------------------------------------------------------
º¸Åë test2.htmlÀ¸·Î º¸³»¼ °ªÀ» ¹ÞÁö¸¸, test3.htmlÀ¸·Î º¸³»¼ ¸ðµÎ´Ù $_REQUEST º¯¼ö·Î ¹ÞÀ»¼ö ÀÖ´Ù.
|
|
̵̧ : 394 |
̵̧
¸ñ·Ï
|
|