View Full Version : how to Save form value into data base

18 Dec 2011, 12:45 PM
In "ext-4.0.7" version the file is 'dynamic.html' (full path : ext-4.0.7\examples\form\dynamic.html) does not work. There is (in 'form' folder) save-form.php file is not present, then i create a save-form.php file and it code is...




$conn = mysql_connect ("localhost", "root", "") or die (mysql_error ());
mysql_select_db ("extjs") or die (mysql_error ());

$q=mysql_query ("INSERT INTO `strawhats` (`first`, `last`, `company`, `email`, `time`) VALUES ('".$_POST['first']."','".$_POST['last']."','".$_POST['company']."','".$_POST['email']."','".$_POST['time']."')
") or die ('{"success":"false"}');

// json output to notify the insert is success or not
if ($q) {
echo '{"success":"true"}';
else {
echo '{"success":"false"}';


please someone help me to do this...


19 Dec 2011, 2:02 AM
i can move this to the ext 4 qa section since we don't have any php forums and don't want to have them. without knowing your DB structure we can not really help you except of guessing.

the only thing that i see directly is that
echo '{"success":"true"}';

should be
echo '{"success":true}';

(same for false), but this affects just your output.

another tip: make sure you are submitting via POST if you use the $_POST. If the params get send via get,...