我正在使用带有一些功能的 php 和 html 创建一个网站。目前我正在使用 .change 和 .load 事件来进行各种获取和显示。我用过
$("#jobtable").load("editjob.php?jobchose=" + $("#jobnoselect").val());
提交并显示php结果,这是一个表单。但是,当我在表单中点击提交时,它什么也不做(我可以看到!)。
表单提交的结果应显示“完成!”
在 Job Select 上执行的代码是
$dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
$selected = mysql_select_db("a9629416_btstats", $dbhandle) or die("Could not select examples");
$jobchose = mysql_real_escape_string($_GET['jobchose']);
$query = "SELECT * FROM MasterJobTable WHERE JobNo='$jobchose'";
$result = mysql_query($query);
$result2 = mysql_query($query);
$current = mysql_fetch_array($result2);
echo "<table>";
echo "<tr>";
echo "<td colspan=\"13\">Current: <h7>" . $current['JobNo'] . "</h7></td>";
echo "</tr>";
echo "<tr>";
echo "<td>NI7S</td>
<td>NI7W</td>
<td>NI7F</td>
<td>NI1V</td>
<td>NI7T</td>
<td>NI7J</td>
<td>NI7K</td>
<td>NI7L</td>
<td>NI7Y</td>
<td>NI1P</td>
<td>NI8T</td>
<td>NI9K</td>
<td>NI6M</td>";
echo "</tr>";
while ($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['NI7S'] . "</td>
<td>" . $row['NI7W'] . "</td>
<td>" . $row['NI7F'] . "</td>
<td>" . $row['NI1V'] . "</td>
<td>" . $row['NI7T'] . "</td>
<td>" . $row['NI7J'] . "</td>
<td>" . $row['NI7K'] . "</td>
<td>" . $row['NI7L'] . "</td>
<td>" . $row['NI7Y'] . "</td>
<td>" . $row['NI1P'] . "</td>
<td>" . $row['NI8T'] . "</td>
<td>" . $row['NI9K'] . "</td>
<td>" . $row['NI6M'] . "</td>";
echo "</tr>";
echo "<br />";
}
echo "<table>";
echo "<tr>";
echo "<td colspan=\"5\">New Standard Units on Job number: <h7>" . $current['JobNo'] . "</h7></td>";
echo "</tr>";
echo "<tr>";
echo "<td>NI7S</td>
<td>NI7W</td>
<td>NI7F</td>
<td>NI1V</td>
<td>NI7T</td>";
echo "</tr>";
echo "<form action=\"doeditjob.php\" method=\"post\">";
echo "<input type=\"hidden\" name=\"jobtoedit\" value=\"" . $current['JobNo'] . "\">";
echo "<tr>";
echo "<td><input type=\"text\" name=\"NI7S\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI7S'] . "\"></td>
<td><input type=\"text\" name=\"NI7W\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI7W'] . "\"></td>
<td><input type=\"text\" name=\"NI7F\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI7F'] . "\"></td>
<td><input type=\"text\" name=\"NI1V\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI1V'] . "\"></td>
<td><input type=\"text\" name=\"NI7T\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI7T'] . "\"></td>";
echo "</tr>";
echo "</table>";
echo "<table>";
echo "<tr>";
echo "<td colspan=\"8\">New DFE Units on Job number: <h7>" . $current['JobNo'] . "</h7></td>";
echo "</tr>";
echo "<tr>";
echo "<td>NI7J</td>
<td>NI7K</td>
<td>NI7L</td>
<td>NI7Y</td>
<td>NI1P</td>
<td>NI8T</td>
<td>NI9K</td>
<td>NI6M</td>";
echo "</tr>";
echo "<tr>";
echo "<td><input type=\"text\" name=\"NI7J\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI7J'] . "\"></td>
<td><input type=\"text\" name=\"NI7K\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI7K'] . "\"></td>
<td><input type=\"text\" name=\"NI7L\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI7L'] . "\"></td>
<td><input type=\"text\" name=\"NI7Y\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI7Y'] . "\"></td>
<td><input type=\"text\" name=\"NI1P\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI1P'] . "\"></td>
<td><input type=\"text\" name=\"NI8T\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI8T'] . "\"></td>
<td><input type=\"text\" name=\"NI9K\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI9K'] . "\"></td>
<td><input type=\"text\" name=\"NI6M\" maxlength=\"4\" size=\"4\" value=\"" . $current['NI6M'] . "\"></td>";
echo "</tr>";
echo "</table>";
echo "<input type=\"submit\" value=\"Update Job\">";
echo "</form>";
而doeditjob.php的代码只是echo "Done!";