|
|
<?
function test($a,$method,$b){
if($method =="1")$result = $a+$b;
if($method =="2")$result = $a-$b;
if($method =="3")$result = $a*$b;
if($method =="4")$result = $a/$b;
echo "°á°ú°ªÀº : ".$result."Àӹ̴ç<br>5ÃÊÈÄ ÀÚµ¿ À̵¿ ÇԹ̴Ù.";
}
//¸ðµå °ªÀÌ ¾øÀ»°æ¿ì °è»ê ÆûÀ» Ãâ·ÂÇÔ.
if($HTTP_POST_VARS[mode] ==""){
echo"
<form name=test action=$PHP_SELF method=post>
<input type=hidden name=mode value=process>
<input type=text name=a size=5>
<select name=method>
<option value=1>+</option>
<option value=2>-</option>
<option value=3>*</option>
<option value=4>/</option>
</select>
<input type=text name=b size=5>
<input type=submit value=°è»êÇϱâ><br>
</form>
";
}// no mode if
//°è»êÇ϶ó´Â process °¡ ÀÖÀ»¶§..
if($HTTP_POST_VARS[mode] == "process"){
test($a,$method,$b);
unset($HTTP_POST_VARS);
//°á°ú°ª º»´ÙÀ½ 5 ÃÊÈÄ ÀÚµ¿ ÆäÀÌÁö À̵¿
echo"<meta http-equiv=\"refresh\" content=\"5; url=$PHP_SELF\">";
}// process mode if
?>
//////Ãß°¡ÀûÀ¸·Î µ¡ºÙÀ̸é ÇÔ¼ö¾È¿¡¼ Æû a,b °ªÀÌ ¼ýÀÚ ÀÎÁö¸¦ °Ë»ç ÇÏ´Â (Á¤±ÔÇ¥Çö½Ä »ç¿ë)°É ³ÖÀ¸¸é ´õ ÁÁ°Ú쬬? ±ÍÂú¾Æ¼¸® ¿©±â±îÁö¸¸ ±×·³ À̸¸ ÈÖ¸®¸¯ |
02-12-06 06:44:04 |
DEL |
|
// ¼³¸í ÇÏÀÚ¸é process °¡ ¾øÀ¸¸é Æû Ãâ·ÂÇϱ¸¿ä
// process °ªÀÖÀ¸¸é °è»êÇØ¼ Ãâ·ÂÇԹ̴Ù.
// º°´Ù¸¥°Å ¾ø´Âµ¥ °µ½Ã¸® ºÎ¿¬¼³¸íÀ» -_-;; ²þ. |
02-12-06 06:45:50 |
DEL |
|
Àú´Â actionÀ» result.php ·ÎÇß½À´Ï´Ù..
¿ì¼± test.php ¼Ò½º
<script language = javascript>
function check() {
if(!cpu.num1.value){
alert("¼ýÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä");
cpu.num1.focus();
return false;
}
if (!cpu.num2.value){
alert("¼ýÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä");
cpu.num2.focus();
return false;
}
}
</script>
<form method = "post" name = "cpu" action = "result.php" onsubmit = "return check()">
<input type = "text" name = "num1" size = "8" maxlength = "8">
<select name = "sign">
<option value = "1">+</option>
<option value = "2">-</option>
<option value = "3">*</option>
<option value = "4">/</option>
</select>
<input type = "text" name = "num2" size = "8" maxlengh = "8">
<input type = "submit" value = "°è»êÇϱâ">
</form> |
02-12-15 20:27:53 |
DEL |
|
result.php ¼Ò½º
<?
switch ($sign) {
case 1 :
$result = $num1 + $num2;
echo "$num1 + $num2 = $result";
break;
case 2 :
$result = $num1 - $num2;
echo "$num1 - $num2 = $result";
break;
case 3 :
$result = $num1 * $num2;
echo "$num1 * $num2 = $result";
break;
case 4 :
$result = $num1 / $num2;
echo "$num1 / $num2 = $result";
break;
default :
echo "¸á¸ª";
break;
}
?> |
02-12-15 20:28:28 |
DEL |
|
ÀüºÎ Ã¥¿¡ ³ª¿ÍÀִ³»¿ë°¡Áö°íÇß½À´Ï´Ù..
¿ÏÀü Â¥Áý±âÁÒ....¤Ñ.¤Ñ;;;;
ÁøÂ¥ ¿ÏÀü Â¥Áý±â..¤Ñ.¤Ñ;;; |
02-12-15 20:29:19 |
DEL |
|
^^ÀßÇϼ̳׿ä~ |
02-12-15 23:55:24 |
DEL |
|
evalÀ» »ç¿ëÇÏ¸é ´õ¿í °£´ÜÇÏÁÒ^^ Çѹø ÇØº¸¼¼¿ä~ |
02-12-15 23:56:06 |
DEL |
|
eval °¡ ¸Ó¡......¤Ñ.¤Ñ;;;
Çѹøµµ ¸óº»°Í °°Àºµ¥¿ä..¤Ñ.¤Ñ;
¾î..ÀÌ»óÇÏ´Ù....¤Ñ.¤Ñ;;;;;;;;;; ¿ÏÀü Á¤µ¶ÇϰíÀִµ¥ |
02-12-16 10:08:09 |
DEL |
|
eval °¡ Ã¥¿¡ ¾îµð³ª¿ÍÀÖ´ÂÁö ²ÀÁ» °¡¸£ÃÄÁֽÿÀ.
±×¸®°í ´Ù¸¥ ¼÷Á¦µµÂÍ ³»ÁֽÿÀ..¼÷Á¦Çϸé¼
ÀÀ¿ëµµÇغ¸°íÇϴϱñ ¸Ó¸®¿¡ ´õ½ï½ï Àßµé¾î¿À´Âµí
ÇÏ¿À....´Ù¸¥¼÷Á¦µµ ³»ÁֽÿÀ... |
02-12-16 11:28:39 |
DEL |
|
evalÀº 552ÆäÀÌÁö¿¡ ÀÖ´Ù¿À~
±×¸®°í ¼÷Á¦´Â ÀϹÝȸ¿øµµ ³¾¼ö ÀÖÀ¸´Ï ¸ÚÁø ¼÷Á¦ Çѹø ½÷ÁÖ½Ã±æ ¹Ù¶ó¿À~ (__) |
02-12-17 02:07:20 |
DEL |
|
ÇãÇã ³ªºñ´ÔÀÌ ±ÍÂ÷´ÏÁòÀ» À̱âÁö¸øÇϸé
²ÜÀº ¾î¶»°Ô ¸Ô´Â´Ü¸»ÀÌ¿À...ÇãÇã
¼÷Á¦³»ÁֽÿÀ.....±Ùµ¥..ÁøÂ¥ Á¦°¡ ³»µµ µÇ¿ä?
¾Æ!±×¸®°í eval´Â ½ºÅ͵𿬶ô¸ÁÀ» ÅëÇØ¼ ã¾Ò¼Ò.. |
02-12-17 09:46:27 |
DEL |
|
<?
if($chk == "ok"){
switch($method){
case "1":
$result = $one + $two;
break;
case "2":
$result = $one - $two;
break;
case "3":
$result = $one * $two;
break;
case "4":
$result = $one / $two;
break;
}
}
?>
<form action="zz.php3" method="post" name="cal">
<input type=text name="one" size=5 value=<?=$one?>>
<select name="method">
<?
$me = array("","+","-","*","/");
for($i=1;$i<5;$i++){
if($method==$i) echo "<option value='$i' selected>$me[$i]</option>";
else echo "<option value='$i'>$me[$i]</option>";
}
?>
</select>
<input type=text name="two" size=5 value=<?=$two?>>
<input type=text name="result" size=5 value=<?=$result?>>
<input type=submit value=°è»êÇϱâ>
<input type="hidden" name="chk" value="ok">
</form> |
03-02-27 15:39:43 |
DEL |
|
¸Ç ÀºÐ if($HTTP_POST_VARS[mode] =="") ÀÌ°Ç if(!$HTTP_POST_VARS[mode]) ÀÌ·¸°ÔÇØÁÖ½Ã¸é ÆíÇϰÚÁÒ~^^ |
04-07-29 14:25:37 |
DEL |
|
<?
function test($a,$method,$b){
if($method =="1")$result = $a+$b;
if($method =="2")$result = $a-$b;
if($method =="3")$result = $a*$b;
if($method =="4")$result = $a/$b;
echo "°á°ú°ªÀº : ".$result."ÀÔ´Ï´Ù.<br>5ÃÊÈÄ ÀÚµ¿ À̵¿ ÇÔ.";
}
//¸ðµå °ªÀÌ ¾øÀ»°æ¿ì °è»ê ÆûÀ» Ãâ·ÂÇÔ.
if($HTTP_POST_VARS[mode] ==""){
echo"
<form name=test action=$PHP_SELF method=post>
<input type=hidden name=mode value=process>
<input type=text name=a size=5>
<select name=method>
<option value=1>+</option>
<option value=2>-</option>
<option value=3>*</option>
<option value=4>/</option>
</select>
<input type=text name=b size=5>
<input type=submit value=°á°ú><br>
</form>
";
}// no mode if
//°è»êÇ϶ó´Â process °¡ ÀÖÀ»¶§..
if($HTTP_POST_VARS[mode] == "process"){
test($a,$method,$b);
unset($HTTP_POST_VARS);
//°á°ú°ª º»´ÙÀ½ 9 ÃÊÈÄ ÀÚµ¿ ÆäÀÌÁö À̵¿
echo"<meta http-equiv=\"refresh\" content=\"9; url=$PHP_SELF\">";
}// process mode if
?> |
05-06-24 16:24:39 |
DEL |
|