可以直接提交a.htm
<form action="b.php" action=post>
<input type=text name=wahaha>
<input type=submit>
</form>b.php
$wahaha = $_POST['wahaha'];
///////////////////////////////////
$sql = "...........";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query))
    echo $row['field'];