[php ¼Ò½º]
<html>
<head>
<title>PHP</title>
<SCRIPT LANGUAGE="JavaScript">
function calc(go){
var kk =eval(go.nn.value);
for(i=0;i<kk;i++){
go.namep[i].value = go.namek[i].value;
go.nameq[i].value = 1;
}
for(i=0;i<kk;i++){
for(j=0;j<kk;j++){
if( eval(go.namep[i].value) < eval(go.namep[j].value) ){
go.nameq[i].value = eval(go.nameq[i].value) +1;
}
}
}
}
</script>
</head>
<body>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<br>
<form name ="ainput" action="jdata00.php" method="post">
<h1>php ¿¬½À</h1><br>
<hr>
n =
<input type=text name="n" maxlength=5 size=5>
<input type="submit" value="È®ÀÎ">
<-ÀÔ·ÂÇÒ dataÀÇ °¹¼ö(data´Â 10°³ÀÌÇÏ)<br>
input.txt<br>
<?php
$form = <<<EOF
<input type=text name="nn" maxlength=5 size=5 value="$n">
EOF;
echo $form;
?>
<br>
<?php
if($n <=10){
for($i=1; $i<=$n; $i++){
?>
<input type=text name="namek" maxlength=5 size=5>
<?php
}
}
?>
<input type="button" value="È®ÀÎ" onclick="calc(this.form)">
<br>
<br>
output.txt <br>
<?php
for($i=1; $i<=$n; $i++){
?>
<input type=text name="namep" maxlength=5 size=5>
<input type=text name="nameq" maxlength=5 size=5>
<br>
<?php
}
?>
<hr>
<br>
</form>
</td>
</tr>
</table>
</body>
</html>
|