谁能介绍一下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'] utf-8 转 gb2312 在“猫扑”上是乱码,其它网站可以。求救! 关于smarty的错误 如何把自己些的shell脚本移植到php网页上面 帮解释一下这个函数,谢谢! 如何让一个内容比较多的网页,一打开就滚动到最下端呢? 已知数组中每个值长度相同,如何增加一个key键呢? JpGraph 生成图片中文乱码的问题 . 谢谢. 身份证号码 烦阿,有关php环境 thinkphp,修改编辑文章打了个隔行Enter提交保存出现如下错误,有办法解决吗? 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