PHP的取值问题 echo $("classname".$_GET["ID"]);试一下??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 AddClass.php中:$id = $_GET['ID'];$name = "classname".$id;$classname = $_POST["$name"]; echo $_POST["classname".$_GET["ID"]]; AddClass.php<?phprequire("db_connect.php");if ($action=="add"){$sql="insert into classname(ClassName)values('".$ClassName."')";$query=mysql_query($sql,$conn);}if ($action=="update"){$ClassName=$_POST["classname".$_GET["ID"]];$sql="update classname set(ClassName='".$ClassName."') where ID=".$ID."";$query=mysql_query($sql,$conn);}if ($action=="del"){$sql="delete from ClassName where ID=".$ID."";$query=mysql_query($sql,$conn);}$sql="select * from ClassName order by Place";$query=mysql_query($sql,$conn);?><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>PHP新闻管理系统</title><link href="css/cssForMenu.css" rel="stylesheet" type="text/css"></head><body topmargin="0" leftmargin="0" bgcolor="#efefef"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td bgcolor="#D1E9E9"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="587" height="22"><strong></strong></td> </tr> </table></td> </tr></table><br><form name="form1" method="POST" action=""> <table width="350" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="cccccc"> <tr align="center" bgcolor="#dfdfdf"> <td height="20">类别名称</td> <td>级别</td> <td>修改</td> <td>删除</td> </tr> <?php while ($line=mysql_fetch_array($query)){ ?> <tr align="center"> <td bgcolor="#efefef"><input name="ClassName<?php echo $line["ID"];?>" type="text" id="ClassName<?php echo $line["ID"];?>" value="<?php echo $line["ClassName"];?>"></td> <td bgcolor="#efefef"><select name="Place" id="Place"> <option>10</option> </select> </td> <td bgcolor="#efefef"> <input type="submit" name="Submit" value="修改" onClick="form1.action='AddClass.php?ID=<?php echo $line["ID"]; ?>&action=update'"></td> <td bgcolor="#efefef"> <input type="submit" name="Submit2" value="删除" onClick="form1.action='AddClass.php?ID=<?php echo $line["ID"]; ?>&action=del'"></td> </tr> <?php } mysql_free_result($query); mysql_close($conn); ?> </table></form><br><form action="AddClass.php?action=add" method="post" name="form" id="form"> <table width="350" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="cccccc"> <tr align="center" bgcolor="dfdfdf"> <td height="20" colspan="3">增加类别名称</td> </tr> <tr align="center"> <td width="172" bgcolor="#efefef"><input name="ClassName" type="text" id="deptname2"></td> <td width="51" bgcolor="#efefef"> <input name="reset" type="reset" id="reset" value="重置"></td> <td width="105" bgcolor="#efefef"> <input type="submit" name="Submit3" value="增加类别名称"> </td> </tr> </table></form></body></html>网站的源代码是这样的,我怎么也得不到值.高手们指点一下我把 <form name="form1" action="" method="post"><input type="text" name="classname" ></form><?php $classname=$_post['ClassName'];?>为什么我这样取值得不到数据呢? $classname=$_POST['ClassName']; $_POST是要大写的 怎么把PHP页面生成html页?? mysql#2002 error 找不到原因 dedecms标签的解析代码写在哪里的 简单问题,变量作为数组下标进行传值得问题!等待中......... 权限模块化的思路,请大家看看对不对,并且有哪些改进? HELP!!!老问题~~还是关于登入的 SESSION问题! 关于加载已做好的多个摸版,高手替顶,请大家说说思路 关于Apache下支持PHP的配置问题 我要上传一组图片,但提交后怎么取不到上传文件的类型? 为什么会超时 请问现在最新的PHP5中的DOM(DOMXML)是否支持中文编码?
$id = $_GET['ID'];
$name = "classname".$id;
$classname = $_POST["$name"];
<?php
require("db_connect.php");
if ($action=="add"){
$sql="insert into classname(ClassName)values('".$ClassName."')";
$query=mysql_query($sql,$conn);
}
if ($action=="update"){
$ClassName=$_POST["classname".$_GET["ID"]];
$sql="update classname set(ClassName='".$ClassName."') where ID=".$ID."";
$query=mysql_query($sql,$conn);
}
if ($action=="del"){
$sql="delete from ClassName where ID=".$ID."";
$query=mysql_query($sql,$conn);
}
$sql="select * from ClassName order by Place";
$query=mysql_query($sql,$conn);?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>PHP新闻管理系统</title>
<link href="css/cssForMenu.css" rel="stylesheet" type="text/css">
</head><body topmargin="0" leftmargin="0" bgcolor="#efefef">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="#D1E9E9"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="587" height="22"><strong></strong></td>
</tr>
</table></td>
</tr>
</table><br>
<form name="form1" method="POST" action="">
<table width="350" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="cccccc">
<tr align="center" bgcolor="#dfdfdf">
<td height="20">类别名称</td>
<td>级别</td>
<td>修改</td>
<td>删除</td>
</tr>
<?php
while ($line=mysql_fetch_array($query)){
?>
<tr align="center">
<td bgcolor="#efefef"><input name="ClassName<?php echo $line["ID"];?>" type="text" id="ClassName<?php echo $line["ID"];?>" value="<?php echo $line["ClassName"];?>"></td>
<td bgcolor="#efefef"><select name="Place" id="Place">
<option>10</option>
</select> </td>
<td bgcolor="#efefef"> <input type="submit" name="Submit" value="修改" onClick="form1.action='AddClass.php?ID=<?php echo $line["ID"]; ?>&action=update'"></td>
<td bgcolor="#efefef"> <input type="submit" name="Submit2" value="删除" onClick="form1.action='AddClass.php?ID=<?php echo $line["ID"]; ?>&action=del'"></td>
</tr>
<?php
}
mysql_free_result($query);
mysql_close($conn);
?>
</table>
</form>
<br>
<form action="AddClass.php?action=add" method="post" name="form" id="form">
<table width="350" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="cccccc">
<tr align="center" bgcolor="dfdfdf">
<td height="20" colspan="3">增加类别名称</td>
</tr>
<tr align="center">
<td width="172" bgcolor="#efefef"><input name="ClassName" type="text" id="deptname2"></td>
<td width="51" bgcolor="#efefef"> <input name="reset" type="reset" id="reset" value="重置"></td>
<td width="105" bgcolor="#efefef"> <input type="submit" name="Submit3" value="增加类别名称">
</td>
</tr>
</table>
</form>
</body>
</html>网站的源代码是这样的,我怎么也得不到值.
高手们指点一下我把
<input type="text" name="classname" >
</form>
<?php
$classname=$_post['ClassName'];
?>
为什么我这样取值得不到数据呢?
$_POST是要大写的