[PHP-users 13626] Re: $BFs<!85G[Ns$N<uEO$K$D$$(B$B$F(B
Kiyohito Mizusako
php-users@php.gr.jp
Fri, 28 Feb 2003 19:24:20 +0900
$B$*@$OC$K$J$C$F$$$^$9!#(Bmizusako $B$G$9!#(B
$B$=$l$J$j$K=PMh$=$&$J%=!<%9$r2<$K=q$$$F$*$-$^$9!#(B
$B%N!<%D%C%3%_$G!#!J>P!K!%!%!%JXMx5!G=$rCN$i$J$$$N$G!"$"$/$^$G%*!<%k%I%m%8%C(B
$B%/$G$9$,!#(B
<?php
$nCol = count($set_data[0]);
$nRow = count($set_data);
if ($act == "add") {
for($row=0; $row<$nRow; $row++) {
for($col=0; $col<$nCol; $col++) {
$tmp[$row][$col] = $set_data[$row][$col];
}
}
if($nCol == 0){
$tmp[0][0] = $new_value[0];
$tmp[0][1] = $new_value[1];
$tmp[0][2] = $new_value[2];
$nCol = 3;
}else{
for($i=0; $i<3; $i++){
$tmp[$nRow][$i] = $new_value[$i];
}
}
$nRow++;
}
//$B%F!<%V%k$N:n@.(B
echo "<FORM name=table method=POST action=\"./sample.php?act=add\">" .
"\n";
echo "<table border=1>" . "\n";
echo "<tr><td align=center>$B9`L\(BA</td><td align=center>$B9`L\(BB</td><td
align=center>$B9`L\(BC</td></tr>" . "\n";
for ($row=0; $row<$nRow; $row++) {
echo "<tr>" . "\n";
for($col=0; $col<$nCol; $col++) {
echo "<td><input name=\"set_data[" . $row . "][" . $col . "]\"
type=text size=30 value={$tmp[$row][$col]}></td>" . "\n";
}
echo "</tr>" . "\n";
}
//$B?75,F~NOMQ(B
echo "<td><input name=new_value[] type=text size=30 value=\"$B!J$3$3$KF~NO!K(B
\"></td>" . "\n";
echo "<td><input name=new_value[] type=text size=30 value=\"$B!J$3$3$KF~NO!K(B
\"></td>" . "\n";
echo "<td><input name=new_value[] type=text size=30 value=\"$B!J$3$3$KF~NO!K(B
\"></td>" . "\n";
echo "</table>" . "\n";
echo "<input type=submit value=$BDI2C(B>" . "\n";
echo "</form>" . "\n";
?>
_/_/_/_/_/_/_/_/_/_/_/_/_/
Mizusako
mizusako@southwave.co.jp
_/_/_/_/_/_/_/_/_/_/_/_/_/_