ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Ãö©óform post ID ªº°ÝÃD

[µ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>
¯«¥H«e³£«Y¤H

¸É¥R: ¥H¤W¬O¦bºô¸ô§ä¦^¨Óªº¡A¤£ª¾«ç¥i¥HPOST ªº ID¡A§Ú·Q°µªº¬O SUBMIT ¤§«á POST ­ÓID«ü¥h²Ä¤G­¶¡A¦n¹³ studentlist.php?id=1 ¤§Ãþ¡A§Æ±æ¦³¤H¥Ó¥X´©¤â§a...
¯«¥H«e³£«Y¤H

TOP

TOP

        ÀR«ä¦Û¦b : ¤@¥y·Å·xªº¸Ü¡A´N¹³©¹§O¤H¨­¤WÅx­»¤ô¡A¦Û¤v·|ªg¨ì¨â¤Tºw¡C
ªð¦^¦Cªí ¤W¤@¥DÃD