- ©«¤l
- 2
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 8
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-7-28
- ³Ì«áµn¿ý
- 2012-8-19
|
[µo°Ý] Ãö©óform post ID ªº°ÝÃD
<?php
header("Content-Type: text/html; charset=utf-8");
require_once("connMysql.php");
?>
<html>
<head>
<title>Student List</title>
<SCRIPT language=JavaScript>
function reload()
{
for(var i=0; i < document.form1.type.length; i++){
if(document.form1.type[i].checked)
var val=document.form1.type[i].value
}
self.location='list-period-demo.php?type=' + val ;
}
</script>
</head>
<body>
<?
$tp=$_GET['type']; // getting the value from query string
if(strlen($tp) > 1){$query="SELECT name,id FROM student where sex='$tp'";}
else{$query="SELECT name,id FROM student";}
echo $query;
$result = mysql_query ($query);
echo "<form name=form1 method=post action='studentlist.php?id=<?php $nt[id];?>'>
<select name=student value=''>Student Name</option>";
while($nt=mysql_fetch_array($result)){
echo "<option value=$nt[id]>$nt[name]</option>";
}
echo "</select>";
// radio buttons frm here ///
echo "
<b>Type</b>
<input type=radio name=type value='male' onclick=\"reload()\";>Male
<input type=radio name=type value='female' onclick=\"reload()\";>Female
<input type=submit value=Submit> </form>";
?>
</body>
</html> |
|