我有一个名为 service.php 的页面,它使用模式窗口打开表单。表单上的操作是 service.php。
<div class="modal hide fade" id="myServiceModal" tabindex="-1" role="dialog" aria-labelleby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Service Failure Form</h3>
</div>
<div class="modal-body">
<p>
<form class="well-small" action="service.php" method="POST" id="serviceModalForm" name="serviceModalForm">
<label>Container Selected</label>
<input type="text" name="containerNumber" id="containerNumber" />
<label>Bol Selected</label>
<input type="text" name="bolNumber" id="bolNumber" />
<input type="submit" id="modal-form-submit" name="submit" class="btn btn-success btn-small" href="#" value="Save" />
<?php
$bol = $_POST['bolNumber'];
$container = $_POST['containerNumber'];
if(isset($_POST['submit'])){
$sql_query_string =
"INSERT INTO import_view_svc_fail (bol, container_num) VALUES
('$bol', '$container');";
if(mysql_query($sql_query_string)){
echo ("<script language='javascript'>
window.alert('Added New Service Failure')
</script>");
}
?>
</form>
此表单有效,并保存到相应的表中。
这是我的问题:我不得不将该表单移动到另一个页面,称为 dispatch.php。我所做的只是复制代码,并将其放在 dispatch.php 上。
我将表单的操作更改为 dispatch.php,这就是我认为问题开始的地方。当我将操作更改回 service.php 时,无论出于何种原因,它都会起作用。
当我从 service.php 中完全删除表单时,dispatch.php 上的表单不再起作用。
我已经尝试了一切来完成这项工作。我从 service.php 中删除了所有代码。我什至从文件夹中删除了整个文件。
任何见解都会有所帮助。