Firebugの[POST]タブには、次のように表示されます。
JSON
textfieldone "Alex"
Source
{"textfieldone :"Alex"}
しかし、[パラメータ]タブに表示されます
_dc 1341332451114
print_r($_REQUEST);
私が取得したときの私のPHPコードで
Array
(
[_dc] => 1341332451114
)
POSTタブで見つかったJSONではありません。どうすればこれを解決できますか?
なぜこれが起こっているのか分かりません、私はこれを一日中デバッグしようとしました
PHPコードを更新します:
<?php
// Make a MySQL Connection
mysql_connect("localhost", "root", "pwd") or die(mysql_error());
mysql_select_db("db") or die(mysql_error());
print_r($_REQUEST);
ファイアバグでは、URLの下に上記の応答が表示されます。
POST http://localhost/proj/php/result.php?_dc=1341332451114 200 OK 107ms
何?_dc=1341366375982
を教えてもらえますか。POSTを送信しています
更新2
EXTJS4コード
モデル
Ext.define ('Mycomp.model.MyClass',{
extend: 'Ext.data.Model',
fields:['textfieldone']
});
見る
Ext.define('Mycomp.view.user.MyClassView', {
extend: 'Ext.window.Window',
alias: 'widget.myclassview',
initComponent: function() {
this.items = [
{
xtype: 'form',
items: [
{
xtype: 'textfield',
name : 'textfieldone',
fieldLabel: 'Contact Person Name'
}
]
}
];
this.buttons = [
{
text: 'Save',
name:'save',
action: 'save'
}
];
this.callParent(arguments);
}
});
コントローラ
Ext.define('Mycomp.controller.MyClass',{
extend: 'Ext.app.Controller',
stores:['MyClass'],
models:['MyClass'],
views:['MyClassView'],
init: function(){
this.control({
'myclassview button[action=save]': {
click: this.myMethod
}
});
},
myMethod: function(button, record) {
var win = button.up('window'),
form = win.down('form'),
values = form.getValues(),
store = this.this.getmyClassStore(),
model = store.model,
record = model.create();
record.set( values );
store.add( record );
win.close();
store.sync();
}
});
お店
Ext.define('Mycomp.store.Myclass',{
extend:'Ext.data.Store',
model:'App.model.Myclass',
proxy: {
actionMethods : {
create : 'POST'
},
type: 'ajax',
url : '/savetodb.php'
}
});