jQuery modal runs fine, but I donβt know what I am missing when I want to display a warning message when the form has successfully completed php?
$.post( 'name.php', { ime: ime, location: location }, function(data){ if (data.success) { alert("form posted!"); } else { $("#dialog-form").dialog("open"); } }, "json" );
==========================
if ($result == false) { echo json_encode(array('success' => false, 'result' => 0)); exit; } echo json_encode(array('success' => true, 'result' => $result)); $sql2 = "DELETE FROM $names WHERE name='$ime'"; $result2 = mysql_query($sql2);
source share