我在 firebug 中收到 500 个内部服务器错误。此代码在 localhost 上运行良好。请帮助我。这是我的代码。我正在上传文件,这就是为什么我也在标签中使用了 action。
<script src="js/jquery.form.js"></script>
<script src="js/create_input.js"></script>
<script>
$(document).ready(function() {
$('#UploadForm').on('submit', function(e) {
e.preventDefault();
var value= $("#valS").val();
var host=$('#host').val(); alert(host);
$(this).ajaxSubmit({
type: "POST",
url: host+"views/excel_import.php",
data: {value: value},
target: '#Exceloutput',
success: afterMsg //call function after success
});
});
});
function afterMsg(msg) {
$("#Exceloutput").html(msg);
}
</script>
<form action="http://localhost/shop/admin/views/excel_import.php" method="post" enctype="multipart/form-data" id="UploadExcel" class="form has-validation">
<div class="clearfix">
<label for="form-upload" class="form-label">Upload File<em>*</em></label>
<div class="form-input">
<input type="file" size="50" class="text" id="excelfile" name="excelfile" required="required"/>
<input type="hidden" size="50" class="text" id="valS" name="valS" value="1" required="required"/>
</div>
</div>
<div class="form-action clearfix">
<button class="button class-button" type="submit" id="SubmitButton">Upload</button>
<button class="button class-button" type="submit" id="updatefields" name="updatefields">UpdateExcel</button>
</div>