|
|
| |
¾Ë¾ÆµÎ¸é Æí¸®ÇÑ FORM ¾×¼Ç Æ®¸¯. |
|
|
|
17³â Àü |
ÇÑ °³ÀÇ form ¾È¿¡ 2°³ ÀÌ»óÀÇ submit ¹öÆ°ÀÌ ÇÊ¿äÇÑ °æ¿ì°¡ Á¾Á¾ÀÖ½À´Ï´Ù.
°¢°¢ÀÇ submit ¹öÆ°ÀÌ ¼·Î ´Ù¸¥ ÇÔ¼ö³ª ½ºÅ©¸³Æ®¸¦ ºÒ·¯¾ß ÇÒ °æ¿ìÀÔ´Ï´Ù.
ÀÌ·±°æ¿ì ¿©·¯°¡Áö ó¸® ¹æ¹ýÀÌ ÀÖÀ» ¼ö ÀÖÁö¸¸, ÀϹÝÀûÀ¸·Î´Â submit ¹öÆ°À» buttonÀ¸·Î Á¤ÀÇÇÑ ÈÄ ÀÚ¹Ù½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇÏ°Ô µË´Ï´Ù.
¿¹¸¦ µé¸é:
<form action="myscript.php">
<input type="text" name="email">
<input type="submit" value="ÁÖ¼Ò·Ï¿¡ ±â·Ï">
<input type="submit" value="½ºÆÔ¸ñ·Ï¿¡ ±â·Ï">
</form>
'ÁÖ¼Ò·Ï¿¡ ±â·Ï'À» ´©¸£¸é myscript.phpÀÇ 'ÁÖ¼Ò·Ï ±â·Ï' ÇÔ¼ö·Î À̵¿ÇÏ°í, '½ºÆÔ¸ñ·Ï¿¡ ±â·Ï'À» ´©¸£¸é '½ºÆÔ¸ñ·Ï ±â·Ï' ÇÔ¼ö·Î °¡·Á°íÇÕ´Ï´Ù.
ÀÚ¹Ù½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇÑ´Ù¸é ¾Æ¸¶µµ ´ÙÀ½°ú °°À» °ÍÀÔ´Ï´Ù.
<form action="myscript.php">
<input type="text" name="email">
<input type="hidden" name="what">
<input type="button" value="ÁÖ¼Ò·Ï¿¡ ±â·Ï" onClick="doSubmit('add_address');">
<input type="button" value="½ºÆÔ¸ñ·Ï¿¡ ±â·Ï" onClick="doSubmit('add_spam');">
</form>
±×¸®°í ³ª¼ doSubmit À̶ó´Â ÀÚ¹Ù½ºÅ©¸³Æ® ÇÔ¼ö¿¡¼ what hidden °ªÀ» ÀûÀýÇÏ°Ô º¯°æÇÑ ÈÄ formÀ» submit ÇÒ °ÍÀÔ´Ï´Ù.
ÀÌ·± °æ¿ì Á¦°¡ Æí¸®ÇÏ°Ô »ç¿ëÇÏ´Â ¹æ¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù.
<form action="myscript.php">
<input type="text" name="email">
<input type="submit" name="what=add_address&k2=v2&k3=v3&" value="ÁÖ¼Ò·Ï¿¡ ±â·Ï">
<input type="submit" name="what=add_spam&k2=v2&k3=v3&" value="½ºÆÔ¸ñ·Ï¿¡ ±â·Ï">
</form>
À§ÀÇ °æ¿ì ó·³ submit ¹öÆ°ÀÇ name¿¡ ¿øÇÏ´Â °ªµéÀ» ÁÖ¾î ÀÌ¿ëÇÏ´Â °ÍÀÔ´Ï´Ù.
ÇÏÁö¸¸, ¾ÆÁ÷ ÀÛµ¿Àº µÇÁö ¾Ê½À´Ï´Ù. ÇÑ°¡Áö ÀÛ¾÷À» ´õ ÇØÁÖ¾î¾ß ÇÕ´Ï´Ù.
submit name¿¡ ÀÔ·ÂÇÑ ¹®ÀÚ¿ÀÌ ÀÚµ¿À¸·Î µðÄÚµù µÇÁö ¾Ê±â ¶§¹®ÀÔ´Ï´Ù.
myscript.php¿¡¼ '%3D' ´Â '='·Î '%26'Àº '&'·Î °¢°¢ µðÄÚµùÇØ ÁÖ¾î¾ß ÇÕ´Ï´Ù.
|
|
̵̧ : 328 |
̵̧
¸ñ·Ï
|
|
| |
|