<form action="four.php" method="post">
<table>
<tr><td><input type="text" name="username"/><input type="hidden" value=<?php echo $a ;?> name="hiddvalue" id="hiddvalue"/><input type="submit" value="提交"/></td></tr>
</table>
</form><?php
$a=1;if ($_POST['username']){
$hid=$_POST['hiddvalue'];
$a=$hid + $a; //然后加加
echo $a;
}else{ echo $a;
}
我的目的是
点击提交,只要框框里不为空,则在$a的基础上加1,
只有这样残能满足你的设想
<?php
$a=1;if ($_POST['username']){
$hid=$_POST['hiddvalue'];
$a=$hid + $a; //然后加加
echo $a;
}else{ echo $a;
}
?>
<form action="four.php" method="post">
<table>
<tr><td><input type="text" name="username"/><input type="hidden" value=<?php echo $a ;?> name="hiddvalue" id="hiddvalue"/><input type="submit" value="提交"/></td></tr>
</table>
</form>
总是输出 1 或 2
总是输出 1 或 2
这是啥意思..