$_POST[] cannot get the value, why???
ԾvԾ人人余耳总
ԾvԾ人人余耳总 2019-06-19 17:49:54
0
2
1571

echo <<<'FORM'

<form action="" method="post">

<input type="number" name = "rows">行

<br/>

<input type="number" name = "cols">列

<input type="submit" value="提交";

</form>

FORM;


$rows = isset($_POST['rows']) ? $_POST['rows'] : 3;

$cols = isset($_POST['cols']) ? $_POST['cols'] : 3;

// $rows = $_POST['rows'];

// $cols = $_POST['cols'];

echo '<table border="1" cellspacing="0" cellpadding="5">';

$i = 0;

while ($i<$rows) {

echo '<tr>';

$j = 0;

while ($j<$cols) {

echo '<td>'.($i * $cols $j).'</td>';

$j ;

}

echo '</tr>';

$i ;

}

echo '</table>';

代码如上,获取不到行和列的数值

ԾvԾ人人余耳总
ԾvԾ人人余耳总

reply all(1)
清音Susunma~

Change the value of the action in the form to the current file name, like this<form action="xx.php" method="post">

  • reply Well, if I go home and write on two separate pages, it’ll be fine. It was found that the form did not have a closing tag and the syntax was wrong. Sorry for wasting your time
    ԾvԾ人人余耳总 author 2019-06-20 16:04:18
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template