php程序从while循环中获取值

时间:2015-10-07 17:18:36

标签: php

嗨,大家好我只是想获得所选单选按钮的价值,但它不起作用帮我们伙伴们。如何提前获得所选的单选按钮值tnx:)

<html>
<head>
<title>asdad</title>
</head>
<body>
<form method = "POST">

<?php
$con=mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('aclc_esys') or die("cannot select DB");
session_start();

$query=mysql_query("SELECT * FROM add_student_subject WHERE student_id = '".$_SESSION['sess_stud_id']."'");

while($row=mysql_fetch_array($query)){

?>

<input type="radio" name="subj" value="<?php$roww['subject_name']?>">


<?php

echo $row['subject_name']."<br />";
}


?>
<input type="submit" value="Submit Evaluation" name="submiteval" />
<?php

if(isset($_POST["submiteval"])){

echo $_POST['subj'];
}


?>
</form>
</body>
</html>

0 个答案:

没有答案