我的看法包含以下代碼到PHP得到錯誤,當我通過Ajax請求發送文本字段值使用煎茶觸摸
this.keypadDisplay = Ext.create('Ext.field.Text', {
xtype:'textfield',
disabled: true,
value: ''
});
我的Ajax請求的代碼是
handler: function(b, e) {
var thisUser = this.getValue();
alert(thisUser);
//params[this.getSubmitParamName()] = this.getValue();
Ext.Ajax.request({
url:'http://localhost/sencha2011/keypadapp/code.php',
params: thisUser,
method:'GET',
success: function(response, opts){
var text = response.responseText;
console.log(response.responseText);
alert(thisUser);
//alert(this.getValue());
//alert('Value: ' + this.getValue());
Ext.Msg.alert('success', text);
},
failure: function(response, opts){
Ext.Msg.alert('Error','Error while submitting the form');
console.log(response.responseText);
},
scope: this
});
}
在這裏,我發現了「this.getValue」成功。我想插入到this.getValue的代碼表。 我code.php包含以下代碼
<?php
$con = mysql_connect("localhost","root","");
mysql_select_db('form',$con);
$insert = "INSERT INTO codetable(password) VALUES ('".$_GET['thisUser.value']."')";
if(mysql_query($insert))
{
echo('values inserted successfully');
}
else
{
echo('failure' . mysql_error());
}
?>
這裏即時得到錯誤的「未定義指數:thisUser.Value在.../keypadapp/code.php」上線5 誰能幫我?在此先感謝...
感謝卡蘭Punamiya,它的工作 – jimmy