0

こんにちは、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
4

1 に答える 1

0

partnum をデータから取り出し、クエリ文字列として使用します。

一般的な 500 エラーが発生しているだけですか? 詳細はありませんか?

リクエスト URL に ?partnum=blah を入れるとどうなりますか?

そのような「データ」にクエリパラメーターが必要かどうかはわかりません。これは、クエリ文字列ではなく、データを対象としています。

于 2012-06-08T20:52:48.313 に答える