test.php
-----------------------------------------------
<form name="form1" method="post" action="">
<input type="text" name="username" value="张三"/>
<input type="hidden" name="uid" value="3">
</form>
<?php
if(isset($_POST['username'])&&!empty($_POST['username']))
{
$username = trim($_POST['username']);
echo $username; // 取得用户id
$id = trim($_POST['uid']);
echo $uid;
}
?>--------------------------------
隐藏表单用于传递参数,这些参数在页面上不可见,
如果你希望它们可见,把type属性改成别的也行:)
-----------------------------------------------
<form name="form1" method="post" action="">
<input type="text" name="username" value="张三"/>
<input type="hidden" name="uid" value="3">
</form>
<?php
if(isset($_POST['username'])&&!empty($_POST['username']))
{
$username = trim($_POST['username']);
echo $username; // 取得用户id
$id = trim($_POST['uid']);
echo $uid;
}
?>--------------------------------
隐藏表单用于传递参数,这些参数在页面上不可见,
如果你希望它们可见,把type属性改成别的也行:)
<input type="hidden" name="send" value="<?php srand((double)date("Ymdhis"));
$randval = rand(1000000,9999999);
echo $randval;
?>">
因为这是很容易hack的,保存下那个页面自己修改了再运行一样可以提交。
密码什么的肯定用session或cookie啦,还用隐藏表单也太笨笨了。