PDA

View Full Version : About Panel with post



just.forever215
14 Dec 2010, 2:58 AM
why the data 'firstName' is null;
but i only run the php it work!
any one can help


This is Js code!
it use a panel not form.panel

var first= firstName.getValue();
Ext.Ajax.request({
url:'../send.php',
params:first,
success: function(response) {
var o = Ext.util.JSON.decode(response.responseText);
if( o.success==true){
Ext.Msg.alert("susses");
}
else
{
Ext.Msg.alert("failure");
}
},
method: "post",
failure: function(){Ext.Msg.alert("failure x1");}
});


Thist is my php Code;
$id = $_REQUEST['first'];
$link = mysql_pconnect("localhost", "root", "770115") or die("Could not connect");
mysql_select_db("test") or die("Could not select database");
mysql_query('SET NAMES UTF8');
$arr = array();
$arr["success"] = true;

$rs = mysql_query("UPDATE `Test`.`List` SET `firstName` = '$id' WHERE `List`.`id` =1;");

evant
14 Dec 2010, 2:59 AM
You never give the parameter a name...



params: {
first: firstName
}