谁能介绍一下php中action 和method的具体的作用和用法? 网页上获取的数据无法通过post方法传递给action后指定的php程序中。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <form name="form1" method="post" action="">不会不可以啊,你的代码是什么?. [align=center]==== 思想重于技巧 ====[/align].贴子分数<20:对自已的问题不予重视。贴子大量未结:对别人的回答不予尊重。. reply via CSDN viewer <html> <head><title>邮政编码查询</title></head> <body bgcolor="white"text="black"link="blue"vlink="purple"alink="red"> <h1 align="center">邮政编码查询系统</h1> <form name="form3"action="zip_query.php"method="post"> <p align="center">请输入要查询的县市区域:<input type="text"name="zone"></p> <p align="center"><input type="submit"name="提交"><input type="reset"name="重设"></p> </form> </body></html>我这段代码就不能把获取的数据传递到下面这段代码里<html> <head><title>查询确认</title><head> <body> <?php $link=mysql_connect('localhost','root','830720')or die("could not connect:".mysql_error()); mysql_query("use db1")or die("could not select database"); $sqlstr="select * from zip where zone='".$_post['zone']."'"; $result=mysql_query($sqlstr,$link)or die("Query failed:".mysql_error()); echo "<center>以下是".$_post['zone']."的邮政编码数据<br><p>"; echo "<table border=1>\n"; echo "<tr>\n"; /*显示表头*/ while($field=mysql_fetch_field($result)) { echo "<td>".$field->name."</td>\n"; } echo "</tr>\n"; /*显示表身*/ while($row=mysql_fetch_row($result)) { echo "<tr>\n"; for($i=0;$i<count($row);$i++) { echo "<td>".$row[$i]."</td>"; } echo "</tr>\n"; } echo "</table>\n"; echo "</center>"; /*释放result*/ mysql_free_result($result); /*关闭连接*/ mysql_close($link); ?> </body></html> 此回复为自动发出,仅用于显示而已,并无任何其他特殊作用楼主【ljctnt】截止到2008-06-27 11:20:25的历史汇总数据(不包括此帖):发帖数:2 发帖分:40 结贴数:0 结贴分:0 未结数:2 未结分:40 结贴率:0.00 % 结分率:0.00 % 如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html 首先看下你的PHP版本,$_post在旧版本里不能用,只能用$HTTP_POST_VARS再看下你的程序里是不是把POST数组的东西给过滤了 action 是你需要跳转的页面 action="***.PHP"method 是你传递参数的方法 method="POST" 或者method="GET"如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html 把post过去的值打印出来看看是什么 这个$_POST应该大写吧,$_POST['zone'] PHPOA中SWF文件上传播放问题,为什么就是播不了?问题在哪? 请问下,怎么用PHP把变量传递给CSS样式表中的url 求帮助,PHP嵌套table问题 缓存文件如何更新? 作内容分页生成html遇到的问题!急啊 请教如何做? 求class.rFastTemplate.php的详细介绍... 各位大哥,小弟想问一下,您用的php的组合是什么, 想创建一个网站,asp.net+sqlserver与php+mysql那一个更有优势? AppServ下页面不显示···(新手小白提问 大神不要鄙视) php导出的excel 做留言板,管理员要对某人进行回复,怎么写代码
[align=center]==== 思想重于技巧 ====
[/align]
.
贴子分数<20:对自已的问题不予重视。
贴子大量未结:对别人的回答不予尊重。
.
<head><title>邮政编码查询</title></head>
<body bgcolor="white"text="black"link="blue"vlink="purple"alink="red">
<h1 align="center">邮政编码查询系统</h1>
<form name="form3"action="zip_query.php"method="post">
<p align="center">请输入要查询的县市区域:<input type="text"name="zone"></p>
<p align="center"><input type="submit"name="提交"><input type="reset"name="重设"></p>
</form>
</body>
</html>
我这段代码就不能把获取的数据传递到下面这段代码里
<html>
<head><title>查询确认</title><head>
<body>
<?php
$link=mysql_connect('localhost','root','830720')or die("could not connect:".mysql_error());
mysql_query("use db1")or die("could not select database");
$sqlstr="select * from zip where zone='".$_post['zone']."'";
$result=mysql_query($sqlstr,$link)or die("Query failed:".mysql_error());
echo "<center>以下是".$_post['zone']."的邮政编码数据<br><p>";
echo "<table border=1>\n";
echo "<tr>\n";
/*显示表头*/
while($field=mysql_fetch_field($result))
{
echo "<td>".$field->name."</td>\n";
}
echo "</tr>\n";
/*显示表身*/
while($row=mysql_fetch_row($result))
{
echo "<tr>\n";
for($i=0;$i<count($row);$i++)
{
echo "<td>".$row[$i]."</td>";
}
echo "</tr>\n";
}
echo "</table>\n";
echo "</center>";
/*释放result*/
mysql_free_result($result);
/*关闭连接*/
mysql_close($link);
?>
</body>
</html>
楼主【ljctnt】截止到2008-06-27 11:20:25的历史汇总数据(不包括此帖):
发帖数:2 发帖分:40
结贴数:0 结贴分:0
未结数:2 未结分:40
结贴率:0.00 % 结分率:0.00 %
如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
method 是你传递参数的方法 method="POST" 或者method="GET"如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html