这个是test1.php
<html>
<head>
<title>
</title>
</head>
<body>
<?php
$connect=mysql_connect("localhost","root","123456");
$select=mysql_select_db("music");
$query="select * from test";
$result=mysql_query($query);
while($row=mysql_fetch_array($result))
{
extract($row);
echo" <form name=form method=post action=test2.php>";
echo" <input type=checkbox name=".$id."/>".$name."<br />";}
?><input type="submit" name="submit" value="提交" /></form>
</body>
</html>表test中的内容是id name
1 basketball
2 football
3 tennis如果选择的是tennis,请问要在test2.php中显示 id的值,程序该怎么写?
我这样写错在哪里?
<?php@extract($_POST);
echo $id;
?>
<html>
<head>
<title>
</title>
</head>
<body>
<?php
$connect=mysql_connect("localhost","root","123456");
$select=mysql_select_db("music");
$query="select * from test";
$result=mysql_query($query);
while($row=mysql_fetch_array($result))
{
extract($row);
echo" <form name=form method=post action=test2.php>";
echo" <input type=checkbox name=".$id."/>".$name."<br />";}
?><input type="submit" name="submit" value="提交" /></form>
</body>
</html>表test中的内容是id name
1 basketball
2 football
3 tennis如果选择的是tennis,请问要在test2.php中显示 id的值,程序该怎么写?
我这样写错在哪里?
<?php@extract($_POST);
echo $id;
?>
php:
print_r($_POST['name']);
//name要用数组的形式
在另一个页面就可以用$_POST['types'] 来获取
请哪位高手给我一个完整的程序