嗨,我正在使用 zen cart 并拥有此代码,我不断收到 500 内部服务器错误,我不确定它是代码还是我的 php 脚本中的某些内容:
<?php
global $db
$partNum = trim(strtolower($_POST['partNum']));
$partNum = mysql_escape_string($partNum);
$query = "SELECT products_model FROM " . TABLE_PRODUCTS . " WHERE products_model = '$partNum' LIMIT 1";
$result = $db->Execute($query);
$num = mysql_num_rows($result);
echo $num;
mysql_close();
和jQuery
jQuery.ajax({
type: "POST",
url: "/includes/templates/theme376/phpScripts/check.php",
data: 'partNum='+ partNum,
cache: false,
success: function(response){
if(response == 1){
$('#partNum').css('border', '3px #C33 solid');
$('#tick').hide();
$('#cross').fadeIn();
}else{
$('#partNum').css('border', '3px #090 solid');
$('#cross').hide();
$('#tick').fadeIn();
}
}
});
这是错误
POST http://mysite.com/includes/templates/theme376/phpScripts/check.php?partNum=wwww 500 (Internal Server Error) /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:38
f.support.ajax.f.ajaxTransport.send /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:38
f.extend.ajax /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:38
partNum_check index.php:307
f.event.dispatch /min/?f=/includes/templates/theme376/jscript/jscript_fileuploader.js,/includes/templates/theme376/jscript/jscript_jquery-1.7.1.min.js,/includes/templates/theme376/jscript/jscript_jquery-ui-1.8.20.custom.min.js,/includes/templates/theme376/jscript/jscript_jquery.nivo.slider.pack.js&1332216833:37
f.event.add.h.handle.i