我試圖用我下載的SDK中提供的標準表單提交表單。在Sencha Touch 2中提交表單
任何人都有關於它是如何通過的信息?有關如何通過它的任何提示?
我試圖做一個非常簡單的提交表單來收集一些信息。
{ title: 'Register',
iconCls: 'add',
xtype: 'formpanel',
url: 'contact.php',
layout: 'vbox',
scrollable: true,
items: [
{
xtype: 'fieldset',
title: 'Opt In',
instructions: 'Want more info on Monster Energy? Opt-in to receive updates. ',
items: [
{
xtype: 'textfield',
label: 'First Name',
name: 'fname',
},
{
xtype: 'textfield',
label: 'Last Name',
name: 'lname',
},
{
xtype: 'emailfield',
label: 'Email',
name: 'email',
},
{
xtype: 'numberfield',
label: 'Phone',
name: 'phone',
}
]
},
{
xtype: 'button',
text: 'Send',
ui: 'confirm',
handler: function() {
this.up('formpanel').submit();
}
}
]
}
contact.php
<?phpinclude_once "config.php";
mysql_connect($dbhost, $dbuser, $dbpasswd);
mysql_select_db($dbname) or die ("Cannot select db" . mysql_error());
session_start();
//***** Get today's date
$today = date("Y-m-d H:i:s");
$date = date("Y-m-d");
$firstName = addslashes($_POST['fname']);
$lastName = addslashes($_POST['lname']);
$email = $_POST['email'];
$phone = $_POST['phone'];
$sql = "INSERT INTO customer_31
(mb_firstName,
mb_lastName,
mb_phone,
mb_email,
mb_date_entered)
VALUES
('$firstName',
'$lastName',
'$phone',
'$email')";
header("location:index.php");
exit();
?>
不知道這是什麼原因...但contact.php缺少一些代碼'的mysql_query($的SQL);' – 2012-09-03 11:27:01