php radio value的接收

来源:百度知道 编辑:UC知道 时间:2024/06/20 13:10:20
上个页面是echo "<tr><td width=100><input type='radio' name='radio' value='$row[0]'>$row[0]";

下个页面是<?php
$xuehao=$_POST['radio'];
mysql_connect("localhost", "root", "");
mysql_select_db("mydb");
$rs=mysql_query("select * from studentInfo where stuNum=$xuehao");
if($rs){
$rsRow=mysql_fetch_row($rs);
echo "<form action='8.php' method='post'>";
echo "更新的学号:$xuehao <br><br>";
echo "姓名:<input type=text name='name' value='$rsRow[1]'><br>";
echo "语文:<input type=text name='ch' value='$rsRow[2]'><br>";
echo "英语:<input type=text name='en' value='$rsRow[3]'><br>";
echo "java:<input type=text name='java' value='$rsRow[4

在 <input type="submit" name="Submit" value="添加" />
前面加一个
<input type="hidden" name="id value="<?=$row[0]?>" /> 提交的时候把ID也提交过去<
<?php

function display_form()

{

global $PHP_SELF;

}
?>

<FORM target=" <?php echo $PHP_SELF;?> " method=post>

Name: <INPUT TYPE=TEXT NAME=" name" ><BR>

Favorite Fruit: <INPUT TYPE=RADIO NAME=" fruit" VALUE=“apple” >Apple

<INPUT TYPE=HIDDEN NAME=" stage" VALUE= " results" >

<INPUT TYPE=SUBMIT VALUE= " Thanks!" >

</FORM >

<?php

function process_form()

{

global $name;

global $fruit;

if ($fruit == "apple") {$fruit_message = "You love apple.";}