私はいくつかの機能を備えたphpとhtmlを使用してWebサイトを作成しています。現時点では、.change および .load イベントを使用して、さまざまなフェッチと表示を行っています。私は使用しました
$("#jobtable").load("editjob.php?jobchose=" + $("#jobnoselect").val());
フォームであるphp結果を送信して表示します。ただし、フォームで送信を押すと、何もしません(わかります!)。
フォーム送信の結果には、「Done!」と表示されます。
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!";