dataString是:AJAX POST到PHP
{"feedback_type":"000","error_type":"","textarea":"blahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblah"}
我用下面的代碼張貼到PHP:
// ajax post
$.ajax({
type: "POST",
url: "core/poster.php" ,
data: dataString,
success:function()
{
alert("Success!");
}
});
return false;
和PHP文件:
<?php
require 'Class_DBOperation.php';
require 'global.php';
// Establish Database Connection
$dbOperation = new class_DBOperation(DBHOST,DBUSER,DBPWD,DBNAME,DBCHARSET);
// Receive dataString
$content=$_POST['feedback_type'];
$run=mysql_query("insert into reports values (NULL, '".$content."')");
?>
的問題是爲什麼$內容是空的? 我該怎麼辦?有任何想法嗎?
奇使用類似名稱'dataString'爲一個對象。 – Blazemonger
BTW,是我正在使用的jQuery版本。 – Samblg