php 传值问题
<formname="form2"method="get"action="change_news.php?id=<?echo$id;?>"><tablewidth="59...
<form name="form2" method="get" action="change_news.php?id=<? echo $id; ?>">
<table width="590" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
序号:<input type="text" name="title" id="title" size="10" maxlength="200" value="<? echo $title; ?>" ></input>
</td>
</tr>
<tr>
<td>
<INPUT type=submit value=确定修改 name=submit><INPUT type=reset value=重新填写 name=reset>
</td>
</tr>
</form>
</table>
///////////////////////
我用上面的这样的代码测试PHP传值,在change_news.php接收页中
<?php
$id=$_GET[id];
$title=$_GET[title];
echo $id;
echo " ";
echo $title;
?>
为什么只接收到$title.而不能把ID传过来呢?(id ,title都是有值的)要怎样修改?我不想用:<input></input>输入ID来传 展开
<table width="590" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
序号:<input type="text" name="title" id="title" size="10" maxlength="200" value="<? echo $title; ?>" ></input>
</td>
</tr>
<tr>
<td>
<INPUT type=submit value=确定修改 name=submit><INPUT type=reset value=重新填写 name=reset>
</td>
</tr>
</form>
</table>
///////////////////////
我用上面的这样的代码测试PHP传值,在change_news.php接收页中
<?php
$id=$_GET[id];
$title=$_GET[title];
echo $id;
echo " ";
echo $title;
?>
为什么只接收到$title.而不能把ID传过来呢?(id ,title都是有值的)要怎样修改?我不想用:<input></input>输入ID来传 展开
1个回答
展开全部
用<form name="form2" method="get" action="change_news.php">
<table width="590" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
序号:<input type="text" name="title" id="title" size="10" maxlength="200" value="<? echo $title; ?>" />
<input name="id" type="hidden" value="<? echo $id; ?>" />
</td>
</tr>
<tr>
<td>
<INPUT type=submit value=确定修改 name=submit><INPUT type=reset value=重新填写 name=reset>
</td>
</tr>
</form>
</table>
或
<form name="form2" method="post" action="change_news.php?id=<? echo $id; ?>">
<table width="590" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
序号:<input type="text" name="title" id="title" size="10" maxlength="200" value="<? echo $title; ?>" />
</td>
</tr>
<tr>
<td>
<INPUT type=submit value=确定修改 name=submit><INPUT type=reset value=重新填写 name=reset>
</td>
</tr>
</form>
</table>
<table width="590" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
序号:<input type="text" name="title" id="title" size="10" maxlength="200" value="<? echo $title; ?>" />
<input name="id" type="hidden" value="<? echo $id; ?>" />
</td>
</tr>
<tr>
<td>
<INPUT type=submit value=确定修改 name=submit><INPUT type=reset value=重新填写 name=reset>
</td>
</tr>
</form>
</table>
或
<form name="form2" method="post" action="change_news.php?id=<? echo $id; ?>">
<table width="590" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
序号:<input type="text" name="title" id="title" size="10" maxlength="200" value="<? echo $title; ?>" />
</td>
</tr>
<tr>
<td>
<INPUT type=submit value=确定修改 name=submit><INPUT type=reset value=重新填写 name=reset>
</td>
</tr>
</form>
</table>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询